From 26f6c1797b1403feeae3d964d09a7b06d202f4c6 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 27 Apr 2014 09:24:25 +0200 Subject: [PATCH] Use strict array_search in DatabasePostgres.php array_search( 'FOR UPDATE', array( 'OFFSET' => 0 ) ) gives 'OFFSET' array_search( 'FOR UPDATE', array( 'OFFSET' => 0 ), true ) gives false This avoids FOR UPDATE on QueryPage query like Special:BrokenRedirect. Bug: 62104 Change-Id: Iaa6db6b3ce5eaf940e7a8afe459955f19ad0e01f --- includes/db/DatabasePostgres.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 3433199864..131b7581a3 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -831,7 +831,7 @@ __INDEXATTR__; $options = array(), $join_conds = array() ) { if ( is_array( $options ) ) { - $forUpdateKey = array_search( 'FOR UPDATE', $options ); + $forUpdateKey = array_search( 'FOR UPDATE', $options, true ); if ( $forUpdateKey !== false && $join_conds ) { unset( $options[$forUpdateKey] ); -- 2.20.1