Merge "resourceloader: Avoid toplevel `<title>` under `<g>` in ResourceLoaderImage"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 16 Jan 2019 00:39:29 +0000 (00:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 16 Jan 2019 00:39:29 +0000 (00:39 +0000)
15 files changed:
includes/Revision.php
includes/diff/TextSlotDiffRenderer.php
includes/exception/MWUnknownContentModelException.php
includes/libs/filebackend/FileBackend.php
includes/libs/mime/XmlTypeCheck.php
includes/parser/ParserOptions.php
includes/specials/SpecialBlock.php
includes/widget/search/InterwikiSearchResultSetWidget.php
tests/phpunit/includes/Revision/RevisionStoreDbTestBase.php
tests/phpunit/includes/media/WebPTest.php
tests/phpunit/includes/poolcounter/PoolWorkArticleViewTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderLessVarFileModuleTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
tests/phpunit/includes/upload/UploadStashTest.php

index b0a3ba3..c99f88a 100644 (file)
@@ -846,6 +846,7 @@ class Revision implements IDBAccessObject {
                $user = $this->mRecord->getUser( $audience, $user );
                return $user ? $user->getName() : '';
        }
+
        /**
         * Fetch revision comment if it's available to the specified audience.
         * If the specified audience does not have access to the comment, an
index 1cc6646..e2cdd82 100644 (file)
@@ -85,6 +85,7 @@ class TextSlotDiffRenderer extends SlotDiffRenderer {
        public function setLanguage( Language $language ) {
                $this->language = $language;
        }
+
        /**
         * @param int $cutoff
         * @see $wgWikiDiff2MovedParagraphDetectionCutoff
index df7111a..9f22815 100644 (file)
@@ -18,6 +18,7 @@ class MWUnknownContentModelException extends MWException {
                        'handle this content model.' );
                $this->modelId = $modelId;
        }
+
        /** @return string */
        public function getModelId() {
                return $this->modelId;
index 27e6924..178831b 100644 (file)
@@ -436,6 +436,7 @@ abstract class FileBackend implements LoggerAwareInterface {
         * @see FileBackend::doOperations()
         * @param array $ops
         * @param array $opts
+        * @return StatusValue
         */
        abstract protected function doOperationsInternal( array $ops, array $opts );
 
@@ -673,6 +674,7 @@ abstract class FileBackend implements LoggerAwareInterface {
        /**
         * @see FileBackend::doQuickOperations()
         * @param array $ops
+        * @return StatusValue
         * @since 1.20
         */
        abstract protected function doQuickOperationsInternal( array $ops );
@@ -819,6 +821,7 @@ abstract class FileBackend implements LoggerAwareInterface {
        /**
         * @see FileBackend::prepare()
         * @param array $params
+        * @return StatusValue
         */
        abstract protected function doPrepare( array $params );
 
@@ -850,6 +853,7 @@ abstract class FileBackend implements LoggerAwareInterface {
        /**
         * @see FileBackend::secure()
         * @param array $params
+        * @return StatusValue
         */
        abstract protected function doSecure( array $params );
 
@@ -883,6 +887,7 @@ abstract class FileBackend implements LoggerAwareInterface {
        /**
         * @see FileBackend::publish()
         * @param array $params
+        * @return StatusValue
         */
        abstract protected function doPublish( array $params );
 
@@ -909,6 +914,7 @@ abstract class FileBackend implements LoggerAwareInterface {
        /**
         * @see FileBackend::clean()
         * @param array $params
+        * @return StatusValue
         */
        abstract protected function doClean( array $params );
 
index a270105..993eea9 100644 (file)
@@ -364,6 +364,7 @@ class XmlTypeCheck {
                        $this->filterMatchType = $callbackReturn;
                }
        }
+
        /**
         * Handle coming across a <!DOCTYPE declaration.
         *
index 8407992..a69e805 100644 (file)
@@ -733,6 +733,7 @@ class ParserOptions {
        public function getMagicPMIDLinks() {
                return $this->getOption( 'magicPMIDLinks' );
        }
+
        /**
         * Are magic RFC links enabled?
         * @since 1.28
index 47d61b8..e47ef06 100644 (file)
@@ -399,6 +399,10 @@ class SpecialBlock extends FormSpecialPage {
                                        $pageRestrictions[] = $restriction->getTitle()->getPrefixedText();
                                }
 
+                               if ( !$block->isSitewide() && empty( $pageRestrictions ) ) {
+                                       $fields['Editing']['default'] = false;
+                               }
+
                                // Sort the restrictions so they are in alphabetical order.
                                sort( $pageRestrictions );
                                $fields['PageRestrictions']['default'] = implode( "\n", $pageRestrictions );
@@ -1158,6 +1162,12 @@ class SpecialBlock extends FormSpecialPage {
         * @return bool|array True for success, false for didn't-try, array of errors on failure
         */
        public function onSubmit( array $data, HTMLForm $form = null ) {
+               // If "Editing" checkbox is unchecked, the block must be a partial block affecting
+               // actions other than editing, and there must be no restrictions.
+               if ( isset( $data['Editing'] ) && $data['Editing'] === false ) {
+                       $data['EditingRestriction'] = 'partial';
+                       $data['PageRestrictions'] = [];
+               }
                return self::processForm( $data, $form->getContext() );
        }
 
index 853601e..c0efd24 100644 (file)
@@ -45,6 +45,7 @@ class InterwikiSearchResultSetWidget implements SearchResultSetWidget {
                $this->output = $specialSearch->getOutput();
                $this->showMultimedia = $showMultimedia;
        }
+
        /**
         * @param string $term User provided search term
         * @param SearchResultSet|SearchResultSet[] $resultSets List of interwiki
index cf5e808..68632f3 100644 (file)
@@ -102,6 +102,7 @@ abstract class RevisionStoreDbTestBase extends MediaWikiTestCase {
                $this->testPageTitle = Title::newFromText( 'UTPage-' . __CLASS__ );
                return $this->testPageTitle;
        }
+
        /**
         * @return WikiPage
         */
index a0a99cc..ac0ad98 100644 (file)
@@ -9,10 +9,12 @@ class WebPHandlerTest extends MediaWikiTestCase {
                // Allocated file for testing
                $this->tempFileName = tempnam( wfTempDir(), 'WEBP' );
        }
+
        public function tearDown() {
                parent::tearDown();
                unlink( $this->tempFileName );
        }
+
        /**
         * @dataProvider provideTestExtractMetaData
         */
@@ -22,6 +24,7 @@ class WebPHandlerTest extends MediaWikiTestCase {
 
                $this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $this->tempFileName ) );
        }
+
        public function provideTestExtractMetaData() {
                // phpcs:disable Generic.Files.LineLength
                return [
@@ -80,6 +83,7 @@ class WebPHandlerTest extends MediaWikiTestCase {
        public function testWithFileExtractMetaData( $filename, $expectedResult ) {
                $this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $filename ) );
        }
+
        public function provideTestWithFileExtractMetaData() {
                return [
                        [ __DIR__ . '/../../data/media/2_webp_ll.webp',
@@ -108,6 +112,7 @@ class WebPHandlerTest extends MediaWikiTestCase {
                $handler = new WebPHandler();
                $this->assertEquals( $expectedResult, $handler->getImageSize( null, $path ) );
        }
+
        public function provideTestGetImageSize() {
                return [
                        // Public domain files from https://developers.google.com/speed/webp/gallery2
@@ -130,6 +135,7 @@ class WebPHandlerTest extends MediaWikiTestCase {
                $mime = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
                $this->assertEquals( 'image/webp', $mime->guessMimeType( $path, false ) );
        }
+
        public function provideTestGetMimeType() {
                return [
                                // Public domain files from https://developers.google.com/speed/webp/gallery2
index 19774f0..016a9a0 100644 (file)
@@ -118,6 +118,7 @@ class PoolWorkArticleViewTest extends MediaWikiTestCase {
                        }
                ];
        }
+
        /**
         * @dataProvider provideMagicWords
         */
index bb51de0..318dce8 100644 (file)
@@ -31,6 +31,7 @@ class ResourceLoaderLessVarFileModuleTest extends ResourceLoaderTestCase {
                        ]
                ];
        }
+
        /**
         * @dataProvider providerWrapAndEscapeMessage
         * @covers ResourceLoaderLessVarFileModule::wrapAndEscapeMessage
index aa3f820..2ee85b5 100644 (file)
@@ -499,6 +499,7 @@ mw.loader.register( [
                        ] ]
                ];
        }
+
        /**
         * @covers ResourceLoaderStartUpModule::getModuleRegistrations
         * @dataProvider provideRegistrations
index 171f2a6..32afd75 100644 (file)
@@ -837,6 +837,7 @@ mw.example();
                        $response
                );
        }
+
        /**
         * Verify that when building the startup module response,
         * an exception from one module class will not break the entire
index e796065..26088a3 100644 (file)
@@ -84,6 +84,7 @@ class UploadStashTest extends MediaWikiTestCase {
                                ] ) ],
                ];
        }
+
        /**
         * @dataProvider provideValidRequests
         */