Merge "Cast block start to int in maintenace SQL"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 8 Dec 2017 20:42:49 +0000 (20:42 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 8 Dec 2017 20:42:49 +0000 (20:42 +0000)
includes/api/ApiFeedWatchlist.php
includes/api/ApiQueryBase.php
includes/parser/LinkHolderArray.php
includes/parser/Parser.php
includes/specials/SpecialUndelete.php
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
tests/phpunit/includes/debug/MWDebugTest.php

index e3a757f..db15032 100644 (file)
@@ -215,10 +215,7 @@ class ApiFeedWatchlist extends ApiBase {
                        preg_match( '!(.*)/\*\s*(.*?)\s*\*/(.*)!', $comment, $matches )
                ) {
                        global $wgParser;
-
-                       $sectionTitle = $wgParser->stripSectionName( $matches[2] );
-                       $sectionTitle = Sanitizer::normalizeSectionNameWhitespace( $sectionTitle );
-                       $titleUrl .= Title::newFromText( '#' . $sectionTitle )->getFragmentForURL();
+                       $titleUrl .= $wgParser->guessSectionNameFromWikiText( $matches[ 2 ] );
                }
 
                $timestamp = $info['timestamp'];
index 8e9b1b4..179e6f7 100644 (file)
@@ -262,7 +262,7 @@ abstract class ApiQueryBase extends ApiBase {
         * @param string|string[] $value Value; ignored if null or empty array;
         */
        protected function addWhereFld( $field, $value ) {
-               if ( $value !== null && count( $value ) ) {
+               if ( $value !== null && !( is_array( $value ) && !$value ) ) {
                        $this->where[$field] = $value;
                }
        }
index bc5182c..816f7f7 100644 (file)
@@ -134,7 +134,7 @@ class LinkHolderArray {
                                $maxId = $newKey > $maxId ? $newKey : $maxId;
                        }
                }
-               $texts = preg_replace_callback( '/(<!--LINK \d+:)(\d+)(-->)/',
+               $texts = preg_replace_callback( '/(<!--LINK\'" \d+:)(\d+)(-->)/',
                        [ $this, 'mergeForeignCallback' ], $texts );
 
                # Renumber interwiki links
@@ -143,7 +143,7 @@ class LinkHolderArray {
                        $this->interwikis[$newKey] = $entry;
                        $maxId = $newKey > $maxId ? $newKey : $maxId;
                }
-               $texts = preg_replace_callback( '/(<!--IWLINK )(\d+)(-->)/',
+               $texts = preg_replace_callback( '/(<!--IWLINK\'" )(\d+)(-->)/',
                        [ $this, 'mergeForeignCallback' ], $texts );
 
                # Set the parent link ID to be beyond the highest used ID
@@ -172,7 +172,7 @@ class LinkHolderArray {
                # Internal links
                $pos = 0;
                while ( $pos < strlen( $text ) ) {
-                       if ( !preg_match( '/<!--LINK (\d+):(\d+)-->/',
+                       if ( !preg_match( '/<!--LINK\'" (\d+):(\d+)-->/',
                                $text, $m, PREG_OFFSET_CAPTURE, $pos )
                        ) {
                                break;
@@ -186,7 +186,7 @@ class LinkHolderArray {
                # Interwiki links
                $pos = 0;
                while ( $pos < strlen( $text ) ) {
-                       if ( !preg_match( '/<!--IWLINK (\d+)-->/', $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
+                       if ( !preg_match( '/<!--IWLINK\'" (\d+)-->/', $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
                                break;
                        }
                        $key = $m[1][0];
@@ -249,12 +249,12 @@ class LinkHolderArray {
                                // Use a globally unique ID to keep the objects mergable
                                $key = $this->parent->nextLinkID();
                                $this->interwikis[$key] = $entry;
-                               $retVal = "<!--IWLINK $key-->{$trail}";
+                               $retVal = "<!--IWLINK'\" $key-->{$trail}";
                        } else {
                                $key = $this->parent->nextLinkID();
                                $ns = $nt->getNamespace();
                                $this->internals[$ns][$key] = $entry;
-                               $retVal = "<!--LINK $ns:$key-->{$trail}";
+                               $retVal = "<!--LINK'\" $ns:$key-->{$trail}";
                        }
                        $this->size++;
                }
@@ -374,7 +374,7 @@ class LinkHolderArray {
                                $title = $entry['title'];
                                $query = isset( $entry['query'] ) ? $entry['query'] : [];
                                $key = "$ns:$index";
-                               $searchkey = "<!--LINK $key-->";
+                               $searchkey = "<!--LINK'\" $key-->";
                                $displayText = $entry['text'];
                                if ( isset( $entry['selflink'] ) ) {
                                        $replacePairs[$searchkey] = Linker::makeSelfLinkObj( $title, $displayText, $query );
@@ -408,7 +408,7 @@ class LinkHolderArray {
 
                # Do the thing
                $text = preg_replace_callback(
-                       '/(<!--LINK .*?-->)/',
+                       '/(<!--LINK\'" .*?-->)/',
                        $replacer->cb(),
                        $text
                );
@@ -437,7 +437,7 @@ class LinkHolderArray {
                $replacer = new HashtableReplacer( $replacePairs, 1 );
 
                $text = preg_replace_callback(
-                       '/<!--IWLINK (.*?)-->/',
+                       '/<!--IWLINK\'" (.*?)-->/',
                        $replacer->cb(),
                        $text );
        }
@@ -612,7 +612,7 @@ class LinkHolderArray {
         */
        public function replaceText( $text ) {
                $text = preg_replace_callback(
-                       '/<!--(LINK|IWLINK) (.*?)-->/',
+                       '/<!--(LINK|IWLINK)\'" (.*?)-->/',
                        [ $this, 'replaceTextCallback' ],
                        $text );
 
index 3548da9..ea58acc 100644 (file)
@@ -3944,7 +3944,7 @@ class Parser {
                        $this->mForceTocPosition = true;
 
                        # Set a placeholder. At the end we'll fill it in with the TOC.
-                       $text = $mw->replace( '<!--MWTOC-->', $text, 1 );
+                       $text = $mw->replace( '<!--MWTOC\'"-->', $text, 1 );
 
                        # Only keep the first one.
                        $text = $mw->replace( '', $text );
@@ -4390,7 +4390,7 @@ class Parser {
                $full .= implode( '', $sections );
 
                if ( $this->mForceTocPosition ) {
-                       return str_replace( '<!--MWTOC-->', $toc, $full );
+                       return str_replace( '<!--MWTOC\'"-->', $toc, $full );
                } else {
                        return $full;
                }
index 0b0bbc0..f821eff 100644 (file)
@@ -465,11 +465,11 @@ class SpecialUndelete extends SpecialPage {
 
                if ( $isText ) {
                        // source view for textual content
-                       $sourceView = new OOUI\MultilineTextInputWidget( [
-                               'readOnly' => true,
-                               'rows' => 25,
-                               'value' => $content->getNativeData() . "\n"
-                       ] );
+                       $sourceView = Xml::element( 'textarea', [
+                               'readonly' => 'readonly',
+                               'cols' => 80,
+                               'rows' => 25
+                       ], $content->getNativeData() . "\n" );
 
                        $buttonFields[] = new OOUI\ButtonInputWidget( [
                                'type' => 'submit',
index 3373ee0..1cd7bef 100644 (file)
@@ -55,7 +55,8 @@
                        icon: 'reload',
                        framed: false,
                        label: mw.msg( 'rcfilters-show-new-changes' ),
-                       flags: [ 'progressive' ]
+                       flags: [ 'progressive' ],
+                       classes: [ 'mw-rcfilters-ui-filterWrapperWidget-showNewChanges' ]
                } );
 
                // Initialize
index 5c65483..25cfd3c 100644 (file)
@@ -110,7 +110,7 @@ class MWDebugTest extends MediaWikiTestCase {
                        $this->assertArrayHasKey( $expectedKey, $data['debuginfo'], "debuginfo has $expectedKey" );
                }
 
-               $xml = ApiFormatXml::recXmlPrint( 'help', $data );
+               $xml = ApiFormatXml::recXmlPrint( 'help', $data, null );
 
                // exception not thrown
                $this->assertInternalType( 'string', $xml );