Merge "Made the prior user existence check in LoginForm use DB_MASTER"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 11 Jul 2015 00:37:31 +0000 (00:37 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 11 Jul 2015 00:37:31 +0000 (00:37 +0000)
includes/Sanitizer.php
includes/User.php
includes/db/Database.php
includes/db/DatabaseMysqlBase.php
includes/parser/Parser.php

index 2340cd9..ddaf1b2 100644 (file)
@@ -753,7 +753,7 @@ class Sanitizer {
                        }
 
                        # Allow any attribute beginning with "data-"
-                       if ( !preg_match( '/^data-/i', $attribute ) && !isset( $whitelist[$attribute] ) ) {
+                       if ( !preg_match( '/^data-(?!ooui)/i', $attribute ) && !isset( $whitelist[$attribute] ) ) {
                                continue;
                        }
 
index dea9750..95ac0f1 100644 (file)
@@ -387,7 +387,8 @@ class User implements IDBAccessObject {
 
                // Try cache (unless this needs to lock the DB).
                // NOTE: if this thread called saveSettings(), the cache was cleared.
-               if ( ( $flags & self::READ_LOCKING ) || !$this->loadFromCache() ) {
+               $locking = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING );
+               if ( $locking || !$this->loadFromCache() ) {
                        wfDebug( "User: cache miss for user {$this->mId}\n" );
                        // Load from DB (make sure this thread sees its own changes)
                        if ( wfGetLB()->hasOrMadeRecentMasterChanges() ) {
index 84c4a66..2f1155d 100644 (file)
@@ -1912,7 +1912,7 @@ abstract class DatabaseBase implements IDatabase {
        ) {
                $rows = 0;
                $sql = $this->selectSQLText( $table, '1', $conds, $fname, $options );
-               $res = $this->query( "SELECT COUNT(*) AS rowcount FROM ($sql) tmp_count" );
+               $res = $this->query( "SELECT COUNT(*) AS rowcount FROM ($sql) tmp_count", $fname );
 
                if ( $res ) {
                        $row = $this->fetchRow( $res );
index e326909..846da1c 100644 (file)
@@ -940,7 +940,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
                                $value = $this->mDefaultBigSelects;
                        }
                } elseif ( $this->mDefaultBigSelects === null ) {
-                       $this->mDefaultBigSelects = (bool)$this->selectField( false, '@@sql_big_selects' );
+                       $this->mDefaultBigSelects = (bool)$this->selectField( false, '@@sql_big_selects', '', __METHOD__ );
                }
                $encValue = $value ? '1' : '0';
                $this->query( "SET sql_big_selects=$encValue", __METHOD__ );
index 7f92590..83c2b0c 100644 (file)
@@ -2147,7 +2147,8 @@ class Parser {
                                $link = substr( $link, 1 );
                        }
 
-                       $nt = Title::newFromText( $this->mStripState->unstripNoWiki( $link ) );
+                       $unstrip = $this->mStripState->unstripNoWiki( $link );
+                       $nt = is_string( $unstrip ) ? Title::newFromText( $unstrip ) : null;
                        if ( $nt === null ) {
                                $s .= $prefix . '[[' . $line;
                                continue;