Use strict array_search in DatabasePostgres.php
authorumherirrender <umherirrender_de.wp@web.de>
Sun, 27 Apr 2014 07:24:25 +0000 (09:24 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sun, 27 Apr 2014 07:24:25 +0000 (09:24 +0200)
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

index 3433199..131b758 100644 (file)
@@ -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] );