Merge "build: Move PHPCS configuration to phpcs.xml"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 9 Jul 2015 17:06:26 +0000 (17:06 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 9 Jul 2015 17:06:26 +0000 (17:06 +0000)
includes/api/ApiQueryImageInfo.php
includes/objectcache/MemcachedClient.php
includes/parser/CoreParserFunctions.php
includes/specials/SpecialMovepage.php
resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js
tests/parser/parserTests.txt

index bcd3c32..ba36c67 100644 (file)
@@ -592,7 +592,10 @@ class ApiQueryImageInfo extends ApiQueryBase {
                $retval = array();
                if ( is_array( $metadata ) ) {
                        foreach ( $metadata as $key => $value ) {
-                               $r = array( 'name' => $key );
+                               $r = array(
+                                       'name' => $key,
+                                       ApiResult::META_BC_BOOLS => array( 'value' ),
+                               );
                                if ( is_array( $value ) ) {
                                        $r['value'] = self::processMetaData( $value, $result );
                                } else {
index 6912864..5010b89 100644 (file)
@@ -94,6 +94,11 @@ class MWMemcached {
         */
        const COMPRESSED = 2;
 
+       /**
+        * Flag: indicates data is an integer
+        */
+       const INTVAL = 4;
+
        // }}}
 
        /**
@@ -979,6 +984,8 @@ class MWMemcached {
                                         */
                                        if ( $flags & self::SERIALIZED ) {
                                                $ret[$rkey] = unserialize( $ret[$rkey] );
+                                       } elseif ( $flags & self::INTVAL ) {
+                                               $ret[$rkey] = intval( $ret[$rkey] );
                                        }
                                }
 
@@ -1027,7 +1034,9 @@ class MWMemcached {
 
                $flags = 0;
 
-               if ( !is_scalar( $val ) ) {
+               if ( is_int( $val ) ) {
+                       $flags |= self::INTVAL;
+               } elseif ( !is_scalar( $val ) ) {
                        $val = serialize( $val );
                        $flags |= self::SERIALIZED;
                        if ( $this->_debug ) {
index cf8cd41..8a30ad1 100644 (file)
@@ -178,7 +178,9 @@ class CoreParserFunctions {
                        default:
                                $func = 'urlencode';
                }
-               return $parser->markerSkipCallback( $s, $func );
+               // See T105242, where the choice to kill markers and various
+               // other options were discussed.
+               return $func( $parser->killMarkers( $s ) );
        }
 
        public static function lcfirst( $parser, $s = '' ) {
index ae1fefe..5682657 100644 (file)
@@ -28,7 +28,7 @@
  */
 class MovePageForm extends UnlistedSpecialPage {
        /** @var Title */
-       protected $oldTitle;
+       protected $oldTitle = null;
 
        /** @var Title */
        protected $newTitle;
@@ -75,9 +75,12 @@ class MovePageForm extends UnlistedSpecialPage {
                // Yes, the use of getVal() and getText() is wanted, see bug 20365
 
                $oldTitleText = $request->getVal( 'wpOldTitle', $target );
-               $this->oldTitle = Title::newFromText( $oldTitleText );
+               if ( is_string( $oldTitleText ) ) {
+                       $this->oldTitle = Title::newFromText( $oldTitleText );
+               }
 
-               if ( is_null( $this->oldTitle ) ) {
+               if ( $this->oldTitle === null ) {
+                       // Either oldTitle wasn't passed, or newFromText returned null
                        throw new ErrorPageError( 'notargettitle', 'notargettext' );
                }
                if ( !$this->oldTitle->exists() ) {
index 9d28080..ec14f8b 100644 (file)
@@ -67,7 +67,7 @@
                        indexpageids: 1,
                        titles: title.getPrefixedDb()
                } ).then( function ( result ) {
-                       if ( result.query.pageids.length > 0 ) {
+                       if ( result.query.pageids && result.query.pageids.length > 0 ) {
                                pageId = result.query.pageids[0];
                                page = result.query.pages[pageId];
 
index 6700225..c71874b 100644 (file)
@@ -20370,10 +20370,12 @@ Strip marker in urlencode
 {{urlencode:x<nowiki/>y}}
 {{urlencode:x<nowiki/>y|wiki}}
 {{urlencode:x<nowiki/>y|path}}
+{{urlencode:x<pre id="one">two</pre>y}}
 !! html
 <p>xy
 xy
 xy
+xy
 </p>
 !! end