Merge "Fix mw.viewport.isElementInViewport with scrolled page"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 10 Mar 2016 19:24:13 +0000 (19:24 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 10 Mar 2016 19:24:13 +0000 (19:24 +0000)
composer.json
includes/Block.php
includes/media/XCF.php
includes/user/User.php
phpcs.xml
tests/phpunit/suites/ExtensionsTestSuite.php

index cf012a4..a21b4e8 100644 (file)
@@ -29,7 +29,7 @@
                "wikimedia/base-convert": "1.0.1",
                "wikimedia/cdb": "1.3.0",
                "wikimedia/cldr-plural-rule-parser": "1.0.0",
-               "wikimedia/composer-merge-plugin": "1.3.0",
+               "wikimedia/composer-merge-plugin": "1.3.1",
                "wikimedia/ip-set": "1.0.1",
                "wikimedia/php-session-serializer": "1.0.3",
                "wikimedia/relpath": "1.0.3",
index 764592d..b8e900d 100644 (file)
@@ -844,7 +844,7 @@ class Block {
                                        'ipb_expiry' => $dbw->timestamp( $this->mExpiry ),
                                ],
                                [ /* WHERE */
-                                       'ipb_address' => (string)$this->getTarget()
+                                       'ipb_id' => $this->getId(),
                                ],
                                __METHOD__
                        );
index f8fa252..526b45e 100644 (file)
@@ -68,21 +68,15 @@ class XCFHandler extends BitmapHandler {
 
                # Forge a return array containing metadata information just like getimagesize()
                # See PHP documentation at: http://www.php.net/getimagesize
-               $metadata = [];
-               $metadata[0] = $header['width'];
-               $metadata[1] = $header['height'];
-               $metadata[2] = null; # IMAGETYPE constant, none exist for XCF.
-               $metadata[3] = sprintf(
-                       'height="%s" width="%s"', $header['height'], $header['width']
-               );
-               $metadata['mime'] = 'image/x-xcf';
-               $metadata['channels'] = null;
-               $metadata['bits'] = 8; # Always 8-bits per color
-
-               assert( '7 == count($metadata); ' .
-                       '# return array must contains 7 elements just like getimagesize() return' );
-
-               return $metadata;
+               return [
+                       0 => $header['width'],
+                       1 => $header['height'],
+                       2 => null, # IMAGETYPE constant, none exist for XCF.
+                       3 => "height=\"{$header['height']}\" width=\"{$header['width']}\"",
+                       'mime' => 'image/x-xcf',
+                       'channels' => null,
+                       'bits' => 8, # Always 8-bits per color
+               ];
        }
 
        /**
index 68a169a..09124bf 100644 (file)
@@ -858,8 +858,6 @@ class User implements IDBAccessObject {
                        || strlen( $name ) > $wgMaxNameChars
                        || $name != $wgContLang->ucfirst( $name )
                ) {
-                       wfDebugLog( 'username', __METHOD__ .
-                               ": '$name' invalid due to empty, IP, slash, length, or lowercase" );
                        return false;
                }
 
@@ -869,8 +867,6 @@ class User implements IDBAccessObject {
                if ( is_null( $parsed )
                        || $parsed->getNamespace()
                        || strcmp( $name, $parsed->getPrefixedText() ) ) {
-                       wfDebugLog( 'username', __METHOD__ .
-                               ": '$name' invalid due to ambiguous prefixes" );
                        return false;
                }
 
@@ -885,8 +881,6 @@ class User implements IDBAccessObject {
                        '\x{e000}-\x{f8ff}' . # private use
                        ']/u';
                if ( preg_match( $unicodeBlacklist, $name ) ) {
-                       wfDebugLog( 'username', __METHOD__ .
-                               ": '$name' invalid due to blacklisted characters" );
                        return false;
                }
 
index 38c7aaa..edce2ea 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -26,9 +26,9 @@
        <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
                <severity>0</severity>
        </rule>
-       <exclude-pattern>node_modules</exclude-pattern>
-       <exclude-pattern>vendor</exclude-pattern>
-       <exclude-pattern>extensions</exclude-pattern>
-       <exclude-pattern>skins</exclude-pattern>
+       <exclude-pattern>node_modules/</exclude-pattern>
+       <exclude-pattern>vendor/</exclude-pattern>
+       <exclude-pattern type="relative">^extensions/</exclude-pattern>
+       <exclude-pattern type="relative">^skins/</exclude-pattern>
        <exclude-pattern>.git</exclude-pattern>
 </ruleset>
index 723328e..0e23fdd 100644 (file)
@@ -8,16 +8,14 @@
 class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
        public function __construct() {
                parent::__construct();
-               $paths = array();
+               $paths = [];
                // Extensions can return a list of files or directories
-               Hooks::run( 'UnitTestsList', array( &$paths ) );
+               Hooks::run( 'UnitTestsList', [ &$paths ] );
                foreach ( $paths as $path ) {
                        if ( is_dir( $path ) ) {
                                // If the path is a directory, search for test cases.
                                // @since 1.24
-                               $suffixes = array(
-                                       'Test.php',
-                               );
+                               $suffixes = [ 'Test.php' ];
                                $fileIterator = new File_Iterator_Facade();
                                $matchingFiles = $fileIterator->getFilesAsArray( $path, $suffixes );
                                $this->addTestFiles( $matchingFiles );
@@ -26,7 +24,7 @@ class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
                                $this->addTestFile( $path );
                        }
                }
-               if ( !count( $paths ) ) {
+               if ( !$paths ) {
                        $this->addTest( new DummyExtensionsTest( 'testNothing' ) );
                }
        }