Merge "Deprecate assertException in MediaWikiTestCase as it adds no value"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 21 Sep 2013 19:00:49 +0000 (19:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 21 Sep 2013 19:00:49 +0000 (19:00 +0000)
72 files changed:
RELEASE-NOTES-1.22
includes/DefaultSettings.php
includes/Exception.php
includes/MagicWord.php
includes/StringUtils.php
includes/installer/DatabaseUpdater.php
includes/parser/CoreParserFunctions.php
includes/parser/Parser.php
includes/parser/Preprocessor_DOM.php
includes/search/SearchEngine.php
languages/messages/MessagesEn.php
maintenance/mssql/tables.sql
maintenance/oracle/tables.sql
maintenance/postgres/tables.sql
maintenance/tidyUpBug37714.php [new file with mode: 0644]
maintenance/update.php
resources/jquery.chosen/chosen-sprite@2x.png
resources/jquery.tipsy/images/tipsy.png
resources/jquery.ui/themes/default/images/ui-bg_flat_0_aaaaaa_40x100.png
resources/jquery.ui/themes/default/images/ui-bg_flat_75_ffffff_40x100.png
resources/jquery.ui/themes/default/images/ui-bg_glass_55_fbf9ee_1x400.png
resources/jquery.ui/themes/default/images/ui-bg_glass_65_ffffff_1x400.png
resources/jquery.ui/themes/default/images/ui-bg_glass_75_dadada_1x400.png
resources/jquery.ui/themes/default/images/ui-bg_highlight-soft_75_cccccc_1x100.png
resources/jquery.ui/themes/vector/images/titlebar-fade.png
resources/jquery/images/jquery.arrowSteps.divider-ltr.png
resources/jquery/images/jquery.arrowSteps.divider-rtl.png
resources/jquery/images/jquery.arrowSteps.head-ltr.png
resources/jquery/images/jquery.arrowSteps.head-rtl.png
resources/jquery/images/jquery.arrowSteps.tail-ltr.png
resources/jquery/images/marker.png
resources/jquery/images/mask.png
resources/mediawiki.special/images/glyph-people-large.png
resources/mediawiki.special/images/icon-contributors.png
resources/mediawiki.special/images/icon-edits.png
resources/mediawiki.special/images/icon-lock.png
resources/mediawiki.special/images/icon-pages.png
resources/mediawiki/images/arrow-collapsed-ltr.png
resources/mediawiki/images/arrow-collapsed-rtl.png
resources/mediawiki/images/arrow-expanded.png
skins/common/images/Arr_u.png
skins/common/images/ar/button_headline.png
skins/common/images/ar/button_nowiki.png
skins/common/images/arrow_disabled_left_25.png
skins/common/images/arrow_disabled_right_25.png
skins/common/images/arrow_right_25.png
skins/common/images/button_hr.png
skins/common/images/button_nowiki.png
skins/common/images/button_sig.png
skins/common/images/button_template.png
skins/common/images/critical-32.png
skins/common/images/fa/button_nowiki.png
skins/common/images/feed-icon.png
skins/common/images/magnify-clip-rtl.png
skins/common/images/question-small.png
skins/common/images/tick-32.png
skins/common/images/warning-32.png
skins/modern/external.png
skins/monobook/external-ltr.png
skins/monobook/external-rtl.png
skins/vector/images/edit-icon.png
skins/vector/images/external-link-ltr-icon.png
skins/vector/images/external-link-rtl-icon.png
skins/vector/images/mail-icon.png
skins/vector/images/news-icon.png
skins/vector/images/page-fade.png
skins/vector/images/portal-break-ltr.png
skins/vector/images/preferences-break.png
skins/vector/images/tab-break.png
skins/vector/images/talk-icon.png
skins/vector/images/video-icon.png
thumb.php

index 34e474a..3112e26 100644 (file)
@@ -54,6 +54,8 @@ production.
   $wgRCFeeds configuration array. $wgRCFeeds makes both the format and
   destination of recent change notifications customizable, and allows for
   multiple destinations to be specified.
+* (bug 53862) portal-url, currentevents-url and helppage have been removed from the
+  default Sidebar.
 
 === New features in 1.22 ===
 * (bug 44525) mediawiki.jqueryMsg can now parse (whitelisted) HTML elements and attributes.
@@ -214,6 +216,9 @@ production.
 * Add deferrable update support for callback/closure
 * Add TitleMove hook before page renames
 * Revision deletion backend code is moved out of SpecialRevisiondelete
+* Add a variable (wgRedactedFunctionArguments) to redact the values sent as certain function
+  parameters from exception stack traces.
+* Added {{REVISIONSIZE}} variable to get the current size of a revision.
 
 === Bug fixes in 1.22 ===
 * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
@@ -230,8 +235,8 @@ production.
 * mw.util.tooltipAccessKeyRegexp: The regex now matches "option-" as well.
   Support for Mac "option" was added in 1.16, but the regex was never updated.
 * (bug 46768) Usernames of blocking users now display correctly, even if numeric.
-* (bug 39590) {{PAGESIZE}} for the current page and self-transclusions now
-  show the most up to date result always instead of being a revision behind.
+* (bug 39590) Self-transclusions now show the most up to date result always
+  after save instead of being a revision behind.
 * A bias in wfRandomString() toward digits 1-7 has been corrected. Generated
   strings will now start with digits 0 and 8-f as often as they should.
 * (bug 45371) Removed Parser_LinkHooks and CoreLinkFunctions classes.
index 22b7f1e..51c6c3d 100644 (file)
@@ -4880,6 +4880,37 @@ $wgShowSQLErrors = false;
  */
 $wgShowExceptionDetails = false;
 
+/**
+ * Array of functions which need parameters redacted from stack traces shown to
+ * clients and logged. Keys are in the format '[class::]function', and the
+ * values should be either an integer or an array of integers. These are the
+ * indexes of the parameters which need to be kept secret.
+ * @since 1.22
+ */
+$wgRedactedFunctionArguments = array(
+       'AuthPlugin::setPassword' => 1,
+       'AuthPlugin::authenticate' => 1,
+       'AuthPlugin::addUser' => 1,
+
+       'DatabaseBase::__construct' => 2,
+       'DatabaseBase::open' => 2,
+
+       'SpecialChangeEmail::attemptChange' => 1,
+       'SpecialChangePassword::attemptReset' => 0,
+
+       'User::setPassword' => 0,
+       'User::setInternalPassword' => 0,
+       'User::checkPassword' => 0,
+       'User::setNewpassword' => 0,
+       'User::comparePasswords' => array( 0, 1 ),
+       'User::checkTemporaryPassword' => 0,
+       'User::setToken' => 0,
+       'User::crypt' => 0,
+       'User::oldCrypt' => 0,
+       'User::getPasswordValidity' => 0,
+       'User::isValidPassword' => 0,
+);
+
 /**
  * If true, show a backtrace for database errors
  */
index e1bfb2d..39fe6f4 100644 (file)
@@ -127,7 +127,7 @@ class MWException extends Exception {
 
                if ( $wgShowExceptionDetails ) {
                        return '<p>' . nl2br( htmlspecialchars( $this->getMessage() ) ) .
-                               '</p><p>Backtrace:</p><p>' . nl2br( htmlspecialchars( $this->getTraceAsString() ) ) .
+                               '</p><p>Backtrace:</p><p>' . nl2br( htmlspecialchars( MWExceptionHandler::formatRedactedTrace( $this ) ) ) .
                                "</p>\n";
                } else {
                        return "<div class=\"errorbox\">" .
@@ -152,7 +152,7 @@ class MWException extends Exception {
 
                if ( $wgShowExceptionDetails ) {
                        return $this->getMessage() .
-                               "\nBacktrace:\n" . $this->getTraceAsString() . "\n";
+                               "\nBacktrace:\n" . MWExceptionHandler::formatRedactedTrace( $this ) . "\n";
                } else {
                        return "Set \$wgShowExceptionDetails = true; " .
                                "in LocalSettings.php to show detailed debugging information.\n";
@@ -275,7 +275,7 @@ class MWException extends Exception {
                $log = $this->getLogMessage();
                if ( $log ) {
                        if ( $wgLogExceptionBacktrace ) {
-                               wfDebugLog( 'exception', $log . "\n" . $this->getTraceAsString() . "\n" );
+                               wfDebugLog( 'exception', $log . "\n" . MWExceptionHandler::formatRedactedTrace( $this ) . "\n" );
                        } else {
                                wfDebugLog( 'exception', $log );
                        }
@@ -633,7 +633,7 @@ class MWExceptionHandler {
                                $message = "MediaWiki internal error.\n\n";
 
                                if ( $wgShowExceptionDetails ) {
-                                       $message .= 'Original exception: ' . $e->__toString() . "\n\n" .
+                                       $message .= 'Original exception: ' . self::formatRedactedTrace( $e ) . "\n\n" .
                                                'Exception caught inside exception handler: ' . $e2->__toString();
                                } else {
                                        $message .= "Exception caught inside exception handler.\n\n" .
@@ -650,11 +650,10 @@ class MWExceptionHandler {
                                }
                        }
                } else {
-                       $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class( $e ) . "\"\n" .
-                               $e->__toString() . "\n";
+                       $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class( $e ) . "\"";
 
                        if ( $wgShowExceptionDetails ) {
-                               $message .= "\n" . $e->getTraceAsString() . "\n";
+                               $message .= "\nexception '" . get_class( $e ) . "' in " . $e->getFile() . ":" . $e->getLine() . "\nStack trace:\n" . self::formatRedactedTrace( $e ) . "\n";
                        }
 
                        if ( $cmdLine ) {
@@ -709,4 +708,53 @@ class MWExceptionHandler {
                // Exit value should be nonzero for the benefit of shell jobs
                exit( 1 );
        }
+
+       /**
+        * Get the stack trace from the exception as a string, redacting certain function arguments in the process
+        * @param Exception $e The exception
+        * @return string The stack trace as a string
+        */
+       public static function formatRedactedTrace( Exception $e ) {
+               global $wgRedactedFunctionArguments;
+               $finalExceptionText = '';
+
+               foreach ( $e->getTrace() as $i => $call ) {
+                       $checkFor = array();
+                       if ( isset( $call['class'] ) ) {
+                               $checkFor[] = $call['class'] . '::' . $call['function'];
+                               foreach ( class_parents( $call['class'] ) as $parent ) {
+                                       $checkFor[] = $parent . '::' . $call['function'];
+                               }
+                       } else {
+                               $checkFor[] = $call['function'];
+                       }
+
+                       foreach ( $checkFor as $check ) {
+                               if ( isset( $wgRedactedFunctionArguments[$check] ) ) {
+                                       foreach ( (array)$wgRedactedFunctionArguments[$check] as $argNo ) {
+                                               $call['args'][$argNo] = 'REDACTED';
+                                       }
+                               }
+                       }
+
+                       $finalExceptionText .= "#{$i} {$call['file']}({$call['line']}): ";
+                       if ( isset( $call['class'] ) ) {
+                               $finalExceptionText .= $call['class'] . $call['type'] . $call['function'];
+                       } else {
+                               $finalExceptionText .= $call['function'];
+                       }
+                       $args = array();
+                       foreach ( $call['args'] as $arg ) {
+                               if ( is_object( $arg ) ) {
+                                       $args[] = 'Object(' . get_class( $arg ) . ')';
+                               } elseif( is_array( $arg ) ) {
+                                       $args[] = 'Array';
+                               } else {
+                                       $args[] = var_export( $arg, true );
+                               }
+                       }
+                       $finalExceptionText .=  '(' . implode( ', ', $args ) . ")\n";
+               }
+               return $finalExceptionText . '#' . ( $i + 1 ) . ' {main}';
+       }
 }
index adb2ab7..427a1ad 100644 (file)
@@ -124,6 +124,7 @@ class MagicWord {
                'revisionyear',
                'revisiontimestamp',
                'revisionuser',
+               'revisionsize',
                'subpagename',
                'subpagenamee',
                'talkspace',
index 9e21d03..c1545e6 100644 (file)
@@ -51,10 +51,6 @@ class StringUtils {
         */
        static function isUtf8( $value, $disableMbstring = false ) {
                $value = (string)$value;
-               if ( preg_match( "/[\x80-\xff]/S", $value ) === 0 ) {
-                       // String contains only ASCII characters, has to be valid
-                       return true;
-               }
 
                // If the mbstring extension is loaded, use it. However, before PHP 5.4, values above
                // U+10FFFF are incorrectly allowed, so we have to check for them separately.
@@ -68,6 +64,11 @@ class StringUtils {
                                ( $newPHP || preg_match( "/\xf4[\x90-\xbf]|[\xf5-\xff]/S", $value ) === 0 );
                }
 
+               if ( preg_match( "/[\x80-\xff]/S", $value ) === 0 ) {
+                       // String contains only ASCII characters, has to be valid
+                       return true;
+               }
+
                // PCRE implements repetition using recursion; to avoid a stack overflow (and segfault)
                // for large input, we check for invalid sequences (<= 5 bytes) rather than valid
                // sequences, which can be as long as the input string is. Multiple short regexes are
index f0c5a21..d4fe530 100644 (file)
@@ -373,7 +373,7 @@ abstract class DatabaseUpdater {
         * @param array $what what updates to perform
         */
        public function doUpdates( $what = array( 'core', 'extensions', 'stats' ) ) {
-               global $wgVersion, $wgLocalisationCacheConf;
+               global $wgVersion;
 
                $this->db->begin( __METHOD__ );
                $what = array_flip( $what );
@@ -390,14 +390,6 @@ abstract class DatabaseUpdater {
                        $this->checkStats();
                }
 
-               if ( isset( $what['purge'] ) ) {
-                       $this->purgeCache();
-
-                       if ( $wgLocalisationCacheConf['manualRecache'] ) {
-                               $this->rebuildLocalisationCache();
-                       }
-               }
-
                $this->setAppliedUpdates( $wgVersion, $this->updates );
 
                if ( $this->fileHandle ) {
index 8df0e2c..70a94fe 100644 (file)
@@ -719,13 +719,7 @@ class CoreParserFunctions {
                $page = $title->getPrefixedText();
 
                $length = 0;
-               if ( $title->equals( $parser->getTitle() )
-                       && $parser->mInputSize !== false
-               ) {
-                       # We are on current page (and not in PST), so
-                       # take length of input to parser.
-                       $length = $parser->mInputSize;
-               } elseif ( isset( $cache[$page] ) ) {
+               if ( isset( $cache[$page] ) ) {
                        $length = $cache[$page];
                } elseif ( $parser->incrementExpensiveFunctionCount() ) {
                        $rev = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
index 3376734..eac2202 100644 (file)
@@ -191,6 +191,7 @@ class Parser {
        var $mRevisionId;   # ID to display in {{REVISIONID}} tags
        var $mRevisionTimestamp; # The timestamp of the specified revision ID
        var $mRevisionUser; # User to display in {{REVISIONUSER}} tag
+       var $mRevisionSize; # Size to display in {{REVISIONSIZE}} variable
        var $mRevIdForTs;   # The revision ID which was used to fetch the timestamp
        var $mInputSize = false; # For {{PAGESIZE}} on current page.
 
@@ -292,7 +293,7 @@ class Parser {
                $this->mLinkHolders = new LinkHolderArray( $this );
                $this->mLinkID = 0;
                $this->mRevisionObject = $this->mRevisionTimestamp =
-                       $this->mRevisionId = $this->mRevisionUser = null;
+                       $this->mRevisionId = $this->mRevisionUser = $this->mRevisionSize = null;
                $this->mVarCache = array();
                $this->mUser = null;
                $this->mLangLinkLanguages = array();
@@ -375,11 +376,13 @@ class Parser {
                $oldRevisionObject = $this->mRevisionObject;
                $oldRevisionTimestamp = $this->mRevisionTimestamp;
                $oldRevisionUser = $this->mRevisionUser;
+               $oldRevisionSize = $this->mRevisionSize;
                if ( $revid !== null ) {
                        $this->mRevisionId = $revid;
                        $this->mRevisionObject = null;
                        $this->mRevisionTimestamp = null;
                        $this->mRevisionUser = null;
+                       $this->mRevisionSize = null;
                }
 
                wfRunHooks( 'ParserBeforeStrip', array( &$this, &$text, &$this->mStripState ) );
@@ -566,6 +569,7 @@ class Parser {
                $this->mRevisionObject = $oldRevisionObject;
                $this->mRevisionTimestamp = $oldRevisionTimestamp;
                $this->mRevisionUser = $oldRevisionUser;
+               $this->mRevisionSize = $oldRevisionSize;
                $this->mInputSize = false;
                wfProfileOut( $fname );
                wfProfileOut( __METHOD__ );
@@ -2904,6 +2908,13 @@ class Parser {
                                wfDebug( __METHOD__ . ": {{REVISIONUSER}} used, setting vary-revision...\n" );
                                $value = $this->getRevisionUser();
                                break;
+                       case 'revisionsize':
+                               # Let the edit saving system know we should parse the page
+                               # *after* a revision ID has been assigned. This is for null edits.
+                               $this->mOutput->setFlag( 'vary-revision' );
+                               wfDebug( __METHOD__ . ": {{REVISIONSIZE}} used, setting vary-revision...\n" );
+                               $value = $this->getRevisionSize();
+                               break;
                        case 'namespace':
                                $value = str_replace( '_', ' ', $wgContLang->getNsText( $this->mTitle->getNamespace() ) );
                                break;
@@ -5803,6 +5814,27 @@ class Parser {
                return $this->mRevisionUser;
        }
 
+       /**
+        * Get the size of the revision
+        *
+        * @return int|null revision size
+        */
+       function getRevisionSize() {
+               if ( is_null( $this->mRevisionSize ) ) {
+                       $revObject = $this->getRevisionObject();
+
+                       # if this variable is subst: the revision id will be blank,
+                       # so just use the parser input size, because the own substituation
+                       # will change the size.
+                       if ( $revObject ) {
+                               $this->mRevisionSize = $revObject->getSize();
+                       } elseif ( $this->ot['wiki'] || $this->mOptions->getIsPreview() ) {
+                               $this->mRevisionSize = $this->mInputSize;
+                       }
+               }
+               return $this->mRevisionSize;
+       }
+
        /**
         * Mutator for $mDefaultSort
         *
index dde0609..3138f48 100644 (file)
@@ -183,21 +183,21 @@ class Preprocessor_DOM implements Preprocessor {
                        $xml = UtfNormal::cleanUp( $xml );
                        // 1 << 19 == XML_PARSE_HUGE, needed so newer versions of libxml2 don't barf when the XML is >256 levels deep
                        $result = $dom->loadXML( $xml, 1 << 19 );
-                       if ( !$result ) {
-                               wfProfileOut( __METHOD__ . '-loadXML' );
-                               if ( $cacheable ) {
-                                       wfProfileOut( __METHOD__ . '-cacheable' );
-                               }
-                               wfProfileOut( __METHOD__ );
-                               throw new MWException( __METHOD__ . ' generated invalid XML' );
-                       }
                }
-               $obj = new PPNode_DOM( $dom->documentElement );
+               if ( $result ) {
+                       $obj = new PPNode_DOM( $dom->documentElement );
+               }
                wfProfileOut( __METHOD__ . '-loadXML' );
+
                if ( $cacheable ) {
                        wfProfileOut( __METHOD__ . '-cacheable' );
                }
+
                wfProfileOut( __METHOD__ );
+
+               if ( !$result ) {
+                       throw new MWException( __METHOD__ . ' generated invalid XML' );
+               }
                return $obj;
        }
 
index e5925fa..71c05d8 100644 (file)
@@ -877,11 +877,11 @@ class SearchResult {
         * @return String: highlighted text snippet, null (and not '') if not supported
         */
        function getTextSnippet( $terms ) {
-               global $wgUser, $wgAdvancedSearchHighlighting;
+               global $wgAdvancedSearchHighlighting;
                $this->initText();
 
                // TODO: make highliter take a content object. Make ContentHandler a factory for SearchHighliter.
-               list( $contextlines, $contextchars ) = SearchEngine::userHighlightPrefs( $wgUser );
+               list( $contextlines, $contextchars ) = SearchEngine::userHighlightPrefs();
                $h = new SearchHighlighter();
                if ( $wgAdvancedSearchHighlighting ) {
                        return $h->highlightText( $this->mText, $terms, $contextlines, $contextchars );
index 5e66259..75b2de9 100644 (file)
@@ -321,6 +321,7 @@ $magicWords = array(
        'revisionyear'            => array( 1,    'REVISIONYEAR' ),
        'revisiontimestamp'       => array( 1,    'REVISIONTIMESTAMP' ),
        'revisionuser'            => array( 1,    'REVISIONUSER' ),
+       'revisionsize'            => array( 1,    'REVISIONSIZE' ),
        'plural'                  => array( 0,    'PLURAL:' ),
        'fullurl'                 => array( 0,    'FULLURL:' ),
        'fullurle'                => array( 0,    'FULLURLE:' ),
index b76f57c..c474f00 100644 (file)
@@ -505,8 +505,6 @@ CREATE TABLE /*$wgDBprefix*/recentchanges (
    rc_this_oldid INT DEFAULT 0,
    rc_last_oldid INT DEFAULT 0,
    rc_type tinyint DEFAULT 0,
-   rc_moved_to_ns BIT DEFAULT 0,
-   rc_moved_to_title NVARCHAR(255)  DEFAULT '',
    rc_patrolled BIT DEFAULT 0,
    rc_ip NCHAR(40) DEFAULT '',
    rc_old_len INT DEFAULT 0,
index 74fb1b1..57b6e7e 100644 (file)
@@ -409,8 +409,6 @@ CREATE TABLE &mw_prefix.recentchanges (
   rc_this_oldid      NUMBER      DEFAULT 0 NOT NULL,
   rc_last_oldid      NUMBER      DEFAULT 0 NOT NULL,
   rc_type            CHAR(1)         DEFAULT '0' NOT NULL,
-  rc_moved_to_ns     NUMBER          DEFAULT 0 NOT NULL,
-  rc_moved_to_title  VARCHAR2(255),
   rc_patrolled       CHAR(1)         DEFAULT '0' NOT NULL,
   rc_ip              VARCHAR2(15),
   rc_old_len         NUMBER,
index 30a8e1b..4d44705 100644 (file)
@@ -405,8 +405,6 @@ CREATE TABLE recentchanges (
   rc_this_oldid      INTEGER      NOT NULL,
   rc_last_oldid      INTEGER      NOT NULL,
   rc_type            SMALLINT     NOT NULL  DEFAULT 0,
-  rc_moved_to_ns     SMALLINT,
-  rc_moved_to_title  TEXT,
   rc_patrolled       SMALLINT     NOT NULL  DEFAULT 0,
   rc_ip              CIDR,
   rc_old_len         INTEGER,
diff --git a/maintenance/tidyUpBug37714.php b/maintenance/tidyUpBug37714.php
new file mode 100644 (file)
index 0000000..1ad9c7e
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * Fixes all rows affected by https://bugzilla.wikimedia.org/show_bug.cgi?id=37714
+ */
+class TidyUpBug37714 extends Maintenance {
+       public function execute() {
+               // Search for all log entries which are about changing the visability of other log entries.
+               $result = wfGetDB( DB_SLAVE )->select(
+                       'logging',
+                       array( 'log_id', 'log_params' ),
+                       array(
+                               'log_type' => array( 'suppress', 'delete' ),
+                               'log_action' => 'event',
+                               'log_namespace' => NS_SPECIAL,
+                               'log_title' => SpecialPage::getTitleFor( 'Log' )->getText()
+                       ),
+                       __METHOD__
+               );
+
+               foreach ( $result as $row ) {
+                       $paramLines = explode( "\n", $row->log_params );
+                       $ids = explode( ',', $paramLines[0] ); // Array dereferencing is PHP >= 5.4 :(
+                       $result = wfGetDB( DB_SLAVE )->select( // Work out what log entries were changed here.
+                               'logging',
+                               'log_type',
+                               array( 'log_id' => $ids ),
+                               __METHOD__,
+                               'DISTINCT'
+                       );
+                       if ( $result->numRows() === 1 ) {
+                               // If there's only one type, the target title can be set to include it.
+                               $logTitle = SpecialPage::getTitleFor( 'Log', $result->current()->log_type )->getText();
+                               $this->output( 'Set log_title to "' . $logTitle . '" for log entry ' . $row->log_id . ".\n" );
+                               wfGetDB( DB_MASTER )->update(
+                                       'logging',
+                                       array( 'log_title' => $logTitle ),
+                                       array( 'log_id' => $row->log_id ),
+                                       __METHOD__
+                               );
+                               wfWaitForSlaves();
+                       }
+               }
+       }
+}
+
+$maintClass = 'TidyUpBug37714';
+require_once RUN_MAINTENANCE_IF_MAIN;
index 5df9f32..378217f 100644 (file)
@@ -140,10 +140,6 @@ class UpdateMediaWiki extends Maintenance {
                                $updates[] = 'noschema';
                        }
                        $updates[] = 'stats';
-
-                       if ( !$this->hasOption( 'nopurge' ) ) {
-                               $updates[] = 'purge';
-                       }
                }
 
                $updater = DatabaseUpdater::newForDb( $db, $shared, $this );
index ffe4d7d..bd61d96 100644 (file)
Binary files a/resources/jquery.chosen/chosen-sprite@2x.png and b/resources/jquery.chosen/chosen-sprite@2x.png differ
index dbbbfc7..ef17cc3 100644 (file)
Binary files a/resources/jquery.tipsy/images/tipsy.png and b/resources/jquery.tipsy/images/tipsy.png differ
index 26b9da5..e425e6e 100644 (file)
Binary files a/resources/jquery.ui/themes/default/images/ui-bg_flat_0_aaaaaa_40x100.png and b/resources/jquery.ui/themes/default/images/ui-bg_flat_0_aaaaaa_40x100.png differ
index b4b148d..72d4757 100644 (file)
Binary files a/resources/jquery.ui/themes/default/images/ui-bg_flat_75_ffffff_40x100.png and b/resources/jquery.ui/themes/default/images/ui-bg_flat_75_ffffff_40x100.png differ
index ad3d634..3b2914a 100644 (file)
Binary files a/resources/jquery.ui/themes/default/images/ui-bg_glass_55_fbf9ee_1x400.png and b/resources/jquery.ui/themes/default/images/ui-bg_glass_55_fbf9ee_1x400.png differ
index 42ccba2..8569c1b 100644 (file)
Binary files a/resources/jquery.ui/themes/default/images/ui-bg_glass_65_ffffff_1x400.png and b/resources/jquery.ui/themes/default/images/ui-bg_glass_65_ffffff_1x400.png differ
index 5a46b47..d6cc3c5 100644 (file)
Binary files a/resources/jquery.ui/themes/default/images/ui-bg_glass_75_dadada_1x400.png and b/resources/jquery.ui/themes/default/images/ui-bg_glass_75_dadada_1x400.png differ
index 7c9fa6c..3cd467e 100644 (file)
Binary files a/resources/jquery.ui/themes/default/images/ui-bg_highlight-soft_75_cccccc_1x100.png and b/resources/jquery.ui/themes/default/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ
index f9fde8b..12a80c8 100644 (file)
Binary files a/resources/jquery.ui/themes/vector/images/titlebar-fade.png and b/resources/jquery.ui/themes/vector/images/titlebar-fade.png differ
index 83d6ff8..84ed2a2 100644 (file)
Binary files a/resources/jquery/images/jquery.arrowSteps.divider-ltr.png and b/resources/jquery/images/jquery.arrowSteps.divider-ltr.png differ
index 529d7b8..7cfbfeb 100644 (file)
Binary files a/resources/jquery/images/jquery.arrowSteps.divider-rtl.png and b/resources/jquery/images/jquery.arrowSteps.divider-rtl.png differ
index 3289617..eb07028 100644 (file)
Binary files a/resources/jquery/images/jquery.arrowSteps.head-ltr.png and b/resources/jquery/images/jquery.arrowSteps.head-ltr.png differ
index 3d9f70c..7ea2fdb 100644 (file)
Binary files a/resources/jquery/images/jquery.arrowSteps.head-rtl.png and b/resources/jquery/images/jquery.arrowSteps.head-rtl.png differ
index 92b872b..3ad990b 100644 (file)
Binary files a/resources/jquery/images/jquery.arrowSteps.tail-ltr.png and b/resources/jquery/images/jquery.arrowSteps.tail-ltr.png differ
index 3929bbb..19efb6c 100644 (file)
Binary files a/resources/jquery/images/marker.png and b/resources/jquery/images/marker.png differ
index b0a4d40..fe08de0 100644 (file)
Binary files a/resources/jquery/images/mask.png and b/resources/jquery/images/mask.png differ
index f43505e..0578be0 100644 (file)
Binary files a/resources/mediawiki.special/images/glyph-people-large.png and b/resources/mediawiki.special/images/glyph-people-large.png differ
index e9b8874..f933aa6 100644 (file)
Binary files a/resources/mediawiki.special/images/icon-contributors.png and b/resources/mediawiki.special/images/icon-contributors.png differ
index f4ec247..39f4f2d 100644 (file)
Binary files a/resources/mediawiki.special/images/icon-edits.png and b/resources/mediawiki.special/images/icon-edits.png differ
index 4b3d4ee..03f0eec 100644 (file)
Binary files a/resources/mediawiki.special/images/icon-lock.png and b/resources/mediawiki.special/images/icon-lock.png differ
index a406ce7..59513db 100644 (file)
Binary files a/resources/mediawiki.special/images/icon-pages.png and b/resources/mediawiki.special/images/icon-pages.png differ
index ea9c67a..b17e578 100644 (file)
Binary files a/resources/mediawiki/images/arrow-collapsed-ltr.png and b/resources/mediawiki/images/arrow-collapsed-ltr.png differ
index 081d3a8..a834548 100644 (file)
Binary files a/resources/mediawiki/images/arrow-collapsed-rtl.png and b/resources/mediawiki/images/arrow-collapsed-rtl.png differ
index fa4bf26..2bec798 100644 (file)
Binary files a/resources/mediawiki/images/arrow-expanded.png and b/resources/mediawiki/images/arrow-expanded.png differ
index 6132836..1aa543a 100644 (file)
Binary files a/skins/common/images/Arr_u.png and b/skins/common/images/Arr_u.png differ
index 04fb8f1..398e561 100644 (file)
Binary files a/skins/common/images/ar/button_headline.png and b/skins/common/images/ar/button_headline.png differ
index 12b986b..743ea61 100644 (file)
Binary files a/skins/common/images/ar/button_nowiki.png and b/skins/common/images/ar/button_nowiki.png differ
index 8f979aa..83df068 100644 (file)
Binary files a/skins/common/images/arrow_disabled_left_25.png and b/skins/common/images/arrow_disabled_left_25.png differ
index 11022f6..aa4fbf8 100644 (file)
Binary files a/skins/common/images/arrow_disabled_right_25.png and b/skins/common/images/arrow_disabled_right_25.png differ
index 9e1b550..3f8fee3 100644 (file)
Binary files a/skins/common/images/arrow_right_25.png and b/skins/common/images/arrow_right_25.png differ
index 19e4ad4..47e1ca4 100644 (file)
Binary files a/skins/common/images/button_hr.png and b/skins/common/images/button_hr.png differ
index c647de2..2ba818d 100644 (file)
Binary files a/skins/common/images/button_nowiki.png and b/skins/common/images/button_nowiki.png differ
index ff7348a..fe34b3f 100644 (file)
Binary files a/skins/common/images/button_sig.png and b/skins/common/images/button_sig.png differ
index 53b6f92..94d9d0b 100644 (file)
Binary files a/skins/common/images/button_template.png and b/skins/common/images/button_template.png differ
index dce5667..9b38e6a 100644 (file)
Binary files a/skins/common/images/critical-32.png and b/skins/common/images/critical-32.png differ
index 12b986b..743ea61 100644 (file)
Binary files a/skins/common/images/fa/button_nowiki.png and b/skins/common/images/fa/button_nowiki.png differ
index 7188fa2..00f49f6 100644 (file)
Binary files a/skins/common/images/feed-icon.png and b/skins/common/images/feed-icon.png differ
index cfddc27..ff85c07 100644 (file)
Binary files a/skins/common/images/magnify-clip-rtl.png and b/skins/common/images/magnify-clip-rtl.png differ
index 590f0cb..f7405d2 100644 (file)
Binary files a/skins/common/images/question-small.png and b/skins/common/images/question-small.png differ
index dfde170..34cfa9c 100644 (file)
Binary files a/skins/common/images/tick-32.png and b/skins/common/images/tick-32.png differ
index b14a831..0400734 100644 (file)
Binary files a/skins/common/images/warning-32.png and b/skins/common/images/warning-32.png differ
index acf260f..6308383 100644 (file)
Binary files a/skins/modern/external.png and b/skins/modern/external.png differ
index acf260f..6308383 100644 (file)
Binary files a/skins/monobook/external-ltr.png and b/skins/monobook/external-ltr.png differ
index 7d5ee37..5313234 100644 (file)
Binary files a/skins/monobook/external-rtl.png and b/skins/monobook/external-rtl.png differ
index 462ca64..43e4691 100644 (file)
Binary files a/skins/vector/images/edit-icon.png and b/skins/vector/images/edit-icon.png differ
index acf260f..6308383 100644 (file)
Binary files a/skins/vector/images/external-link-ltr-icon.png and b/skins/vector/images/external-link-ltr-icon.png differ
index 7d5ee37..5313234 100644 (file)
Binary files a/skins/vector/images/external-link-rtl-icon.png and b/skins/vector/images/external-link-rtl-icon.png differ
index 9823d72..0d93a2f 100644 (file)
Binary files a/skins/vector/images/mail-icon.png and b/skins/vector/images/mail-icon.png differ
index ade1a37..6f27054 100644 (file)
Binary files a/skins/vector/images/news-icon.png and b/skins/vector/images/news-icon.png differ
index 1436cda..b4a6034 100644 (file)
Binary files a/skins/vector/images/page-fade.png and b/skins/vector/images/page-fade.png differ
index cec17ea..20bf366 100644 (file)
Binary files a/skins/vector/images/portal-break-ltr.png and b/skins/vector/images/portal-break-ltr.png differ
index e59f578..b529308 100644 (file)
Binary files a/skins/vector/images/preferences-break.png and b/skins/vector/images/preferences-break.png differ
index c03c72e..6d37af5 100644 (file)
Binary files a/skins/vector/images/tab-break.png and b/skins/vector/images/tab-break.png differ
index c443435..0332054 100644 (file)
Binary files a/skins/vector/images/talk-icon.png and b/skins/vector/images/talk-icon.png differ
index e934a0f..ed85232 100644 (file)
Binary files a/skins/vector/images/video-icon.png and b/skins/vector/images/video-icon.png differ
index 2b68927..2cda344 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -171,20 +171,17 @@ function wfStreamThumb( array $params ) {
                $redirectedLocation = false;
                if ( !$isTemp ) {
                        // Check for file redirect
-                       if ( $isOld ) {
-                               // Since redirects are associated with pages, not versions of files,
-                               // we look for the most current version to see if its a redirect.
-                               $possibleRedirFile = RepoGroup::singleton()->getLocalRepo()->findFile( $img->getName() );
-                       } else {
-                               $possibleRedirFile = RepoGroup::singleton()->getLocalRepo()->findFile( $fileName );
-                       }
-                       if ( $possibleRedirFile && !is_null( $possibleRedirFile->getRedirected() ) ) {
-                               $redirTarget = $possibleRedirFile->getName();
+                       // Since redirects are associated with pages, not versions of files,
+                       // we look for the most current version to see if its a redirect.
+                       $possRedirFile = RepoGroup::singleton()->getLocalRepo()->findFile( $img->getName() );
+                       if ( $possRedirFile && !is_null( $possRedirFile->getRedirected() ) ) {
+                               $redirTarget = $possRedirFile->getName();
                                $targetFile = wfLocalFile( Title::makeTitleSafe( NS_FILE, $redirTarget ) );
                                if ( $targetFile->exists() ) {
                                        $newThumbName = $targetFile->thumbName( $params );
                                        if ( $isOld ) {
-                                               $newThumbUrl = $targetFile->getArchiveThumbUrl( $bits[0] . '!' . $targetFile->getName(), $newThumbName );
+                                               $newThumbUrl = $targetFile->getArchiveThumbUrl(
+                                                       $bits[0] . '!' . $targetFile->getName(), $newThumbName );
                                        } else {
                                                $newThumbUrl = $targetFile->getThumbUrl( $newThumbName );
                                        }