From: umherirrender Date: Sun, 27 Apr 2014 07:24:25 +0000 (+0200) Subject: Use strict array_search in DatabasePostgres.php X-Git-Tag: 1.31.0-rc.0~15998^2 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=26f6c1797b1403feeae3d964d09a7b06d202f4c6;p=lhc%2Fweb%2Fwiklou.git 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 --- 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] );