Merge "Added a link to Developer Hub in docs/README, Sectioning minor rewording,...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 31 Jul 2016 19:01:17 +0000 (19:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 31 Jul 2016 19:01:17 +0000 (19:01 +0000)
README
includes/db/loadbalancer/LoadBalancer.php
includes/page/WikiPage.php
includes/profiler/TransactionProfiler.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/specials/pagers/ImageListPager.php
resources/src/mediawiki/mediawiki.Title.js
resources/src/mediawiki/mediawiki.htmlform.ooui.css

diff --git a/README b/README
index 6352e62..737c688 100644 (file)
--- a/README
+++ b/README
@@ -23,7 +23,7 @@ RELEASE-NOTES, INSTALL, and UPGRADE.
 * Seeking help from a person?
 ** https://www.mediawiki.org/wiki/Communication
 * Looking to file a bug report or a feature request?
-** https://bugs.mediawiki.org/
+** https://phabricator.wikimedia.org/
 * Interested in helping out?
 ** https://www.mediawiki.org/wiki/How_to_contribute
 
index 2543958..dbf031e 100644 (file)
@@ -1314,12 +1314,15 @@ class LoadBalancer {
                        $cache->makeGlobalKey( __CLASS__, 'server-read-only', $masterServer ),
                        self::TTL_CACHE_READONLY,
                        function () use ( $wiki, $conn ) {
+                               $this->trxProfiler->setSilenced( true );
                                try {
                                        $dbw = $conn ?: $this->getConnection( DB_MASTER, [], $wiki );
-                                       return (int)$dbw->serverIsReadOnly();
+                                       $readOnly = (int)$dbw->serverIsReadOnly();
                                } catch ( DBError $e ) {
-                                       return 0;
+                                       $readOnly = 0;
                                }
+                               $this->trxProfiler->setSilenced( false );
+                               return $readOnly;
                        },
                        [ 'pcTTL' => $cache::TTL_PROC_LONG, 'busyValue' => 0 ]
                );
index 46fef10..26028b1 100644 (file)
@@ -1834,7 +1834,8 @@ class WikiPage implements Page, IDBAccessObject {
                                        ContentHandler::runLegacyHooks( 'ArticleSaveComplete', $params );
                                        Hooks::run( 'PageContentSaveComplete', $params );
                                }
-                       )
+                       ),
+                       DeferredUpdates::PRESEND
                );
 
                return $status;
@@ -1959,7 +1960,8 @@ class WikiPage implements Page, IDBAccessObject {
                                        Hooks::run( 'PageContentSaveComplete', $params );
 
                                }
-                       )
+                       ),
+                       DeferredUpdates::PRESEND
                );
 
                return $status;
index 1aba71c..bf26573 100644 (file)
@@ -38,6 +38,8 @@ class TransactionProfiler implements LoggerAwareInterface {
        protected $dbLockThreshold = 3.0;
        /** @var float Seconds */
        protected $eventThreshold = .25;
+       /** @var bool */
+       protected $silenced = false;
 
        /** @var array transaction ID => (write start time, list of DBs involved) */
        protected $dbTrxHoldingLocks = [];
@@ -77,6 +79,14 @@ class TransactionProfiler implements LoggerAwareInterface {
                $this->logger = $logger;
        }
 
+       /**
+        * @param bool $value
+        * @since 1.28
+        */
+       public function setSilenced( $value ) {
+               $this->silenced = $value;
+       }
+
        /**
         * Set performance expectations
         *
@@ -302,6 +312,10 @@ class TransactionProfiler implements LoggerAwareInterface {
         * @param string|float|int $actual [optional]
         */
        protected function reportExpectationViolated( $expect, $query, $actual = null ) {
+               if ( $this->silenced ) {
+                       return;
+               }
+
                $n = $this->expect[$expect];
                $by = $this->expectBy[$expect];
                $actual = ( $actual !== null ) ? " (actual: $actual)" : "";
index 7b2d532..eb9788c 100644 (file)
@@ -66,6 +66,8 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        }
                }
 
+               $illegalFileChars = $conf->get( 'IllegalFileChars' );
+
                // Build list of variables
                $vars = [
                        'wgLoadScript' => wfScript( 'load' ),
@@ -107,6 +109,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        'wgResourceLoaderMaxQueryLength' => $conf->get( 'ResourceLoaderMaxQueryLength' ),
                        'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces,
                        'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ),
+                       'wgIllegalFileChars' => Title::convertByteClassToUnicodeClass( $illegalFileChars ),
                        'wgResourceLoaderStorageVersion' => $conf->get( 'ResourceLoaderStorageVersion' ),
                        'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ),
                        'wgResourceLoaderLegacyModules' => self::getLegacyModules(),
index 40706fa..5e10269 100644 (file)
@@ -429,8 +429,11 @@ class ImageListPager extends TablePager {
                                // If statement for paranoia
                                if ( $file ) {
                                        $thumb = $file->transform( [ 'width' => 180, 'height' => 360 ] );
-
-                                       return $thumb->toHtml( [ 'desc-link' => true ] );
+                                       if ( $thumb ) {
+                                               return $thumb->toHtml( [ 'desc-link' => true ] );
+                                       } else {
+                                               return wfMessage( 'thumbnail_error', '' )->escaped();
+                                       }
                                } else {
                                        return htmlspecialchars( $value );
                                }
index ff4d1c2..4c57faa 100644 (file)
                },
                // slash, colon (not supported by file systems like NTFS/Windows, Mac OS 9 [:], ext4 [/])
                {
-                       pattern: /[:\/#]/g,
+                       pattern: new RegExp( '[' + mw.config.get( 'wgIllegalFileChars', '' ) + ']', 'g' ),
                        replace: '-',
                        fileRule: true
                },
index 5b9d88c..a9e75d7 100644 (file)
@@ -19,6 +19,9 @@
        width: 39%;
 }
 
+/* Flatlist styling for PHP widgets... */
+.mw-htmlform-flatlist .oo-ui-fieldLayout-align-inline,
+/* ...and for JS widgets */
 .mw-htmlform-flatlist .oo-ui-optionWidget,
 .mw-htmlform-flatlist .oo-ui-multioptionWidget {
        display: inline-block;