Merge "selenium: Add jpeg-js to devDependencies"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 10 May 2019 17:19:18 +0000 (17:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 10 May 2019 17:19:18 +0000 (17:19 +0000)
RELEASE-NOTES-1.34
includes/EditPage.php
includes/OutputPage.php
includes/parser/ParserOutput.php
includes/user/User.php
languages/Language.php
languages/messages/MessagesBn.php
tests/phpunit/includes/user/UserTest.php
tests/phpunit/languages/LanguageTest.php

index 786dae2..03a42c2 100644 (file)
@@ -39,7 +39,8 @@ For notes on 1.33.x and older releases, see HISTORY.
 * …
 
 === New developer features in 1.34 ===
-* …
+* Language::formatTimePeriod now supports the new 'avoidhours' option to output
+  strings like "5 days ago" instead of "5 days 13 hours ago".
 
 === External library changes in 1.34 ===
 
@@ -143,6 +144,9 @@ because of Phabricator reports.
   1.28, have been removed.
 * PageArchive::getTextFromRow(), ::listAllPages(), and ::getLastRevisionText(),
   deprecated in 1.32, have been removed.
+* OutputPage::getModuleScripts(), ParserOutput::getModuleScripts(), deprecated
+  in 1.33, have been removed.
+* User::getPasswordValidity(), deprecated in 1.33, has been removed.
 * …
 
 === Deprecations in 1.34 ===
index b2044e2..7908fcc 100644 (file)
@@ -2934,7 +2934,7 @@ ERROR;
                }
 
                if ( !$this->mTitle->isUserConfigPage() ) {
-                       $out->addHTML( self::getEditToolbar( $this->mTitle ) );
+                       $out->addHTML( self::getEditToolbar() );
                }
 
                if ( $this->blankArticle ) {
@@ -4101,10 +4101,9 @@ ERROR;
        /**
         * Allow extensions to provide a toolbar.
         *
-        * @param Title|null $title Title object for the page being edited (optional)
         * @return string|null
         */
-       public static function getEditToolbar( $title = null ) {
+       public static function getEditToolbar() {
                $startingToolbar = '<div id="toolbar"></div>';
                $toolbar = $startingToolbar;
 
index 641f0b8..c45fce7 100644 (file)
@@ -548,15 +548,6 @@ class OutputPage extends ContextSource {
                $this->mModules = array_merge( $this->mModules, (array)$modules );
        }
 
-       /**
-        * @deprecated since 1.33 Use getModules() instead.
-        * @return array
-        */
-       public function getModuleScripts() {
-               wfDeprecated( __METHOD__, '1.33' );
-               return [];
-       }
-
        /**
         * Get the list of style-only modules to load on this page.
         *
index 9a1653d..cc70713 100644 (file)
@@ -510,11 +510,6 @@ class ParserOutput extends CacheTime {
                return $this->mModules;
        }
 
-       public function getModuleScripts() {
-               wfDeprecated( __METHOD__, '1.33' );
-               return [];
-       }
-
        public function getModuleStyles() {
                return $this->mModuleStyles;
        }
index 2f6deb5..18d62f5 100644 (file)
@@ -1162,35 +1162,6 @@ class User implements IDBAccessObject, UserIdentity {
                return $this->checkPasswordValidity( $password )->isGood();
        }
 
-       /**
-        * Given unvalidated password input, return error message on failure.
-        *
-        * @param string $password Desired password
-        * @return bool|string|array True on success, string or array of error message on failure
-        * @deprecated since 1.33, use checkPasswordValidity
-        */
-       public function getPasswordValidity( $password ) {
-               wfDeprecated( __METHOD__, '1.33' );
-
-               $result = $this->checkPasswordValidity( $password );
-               if ( $result->isGood() ) {
-                       return true;
-               }
-
-               $messages = [];
-               foreach ( $result->getErrorsByType( 'error' ) as $error ) {
-                       $messages[] = $error['message'];
-               }
-               foreach ( $result->getErrorsByType( 'warning' ) as $warning ) {
-                       $messages[] = $warning['message'];
-               }
-               if ( count( $messages ) === 1 ) {
-                       return $messages[0];
-               }
-
-               return $messages;
-       }
-
        /**
         * Check if this is a valid password for this user
         *
index 3a12439..2262fa7 100644 (file)
@@ -4658,6 +4658,7 @@ class Language {
         *
         * @param int|float $seconds
         * @param array $format An optional argument that formats the returned string in different ways:
+        *   If $format['avoid'] === 'avoidhours': don't show hours, just show days
         *   If $format['avoid'] === 'avoidseconds': don't show seconds if $seconds >= 1 hour,
         *   If $format['avoid'] === 'avoidminutes': don't show seconds/minutes if $seconds > 48 hours,
         *   If $format['noabbrevs'] is true: use 'seconds' and friends instead of 'seconds-abbrev'
@@ -4716,12 +4717,19 @@ class Language {
                        $s = $hoursMsg->params( $this->formatNum( $hours ) )->text();
                        $s .= ' ';
                        $s .= $minutesMsg->params( $this->formatNum( $minutes ) )->text();
-                       if ( !in_array( $format['avoid'], [ 'avoidseconds', 'avoidminutes' ] ) ) {
+                       if ( !in_array( $format['avoid'], [ 'avoidseconds', 'avoidminutes', 'avoidhours' ] ) ) {
                                $s .= ' ' . $secondsMsg->params( $this->formatNum( $secondsPart ) )->text();
                        }
                } else {
                        $days = floor( $seconds / 86400 );
-                       if ( $format['avoid'] === 'avoidminutes' ) {
+                       if ( $format['avoid'] === 'avoidhours' ) {
+                               $hours = round( ( $seconds - $days * 86400 ) / 3600 );
+                               if ( $hours == 24 ) {
+                                       $hours = 0;
+                                       $days++;
+                               }
+                               $s = $daysMsg->params( $this->formatNum( $days ) )->text();
+                       } elseif ( $format['avoid'] === 'avoidminutes' ) {
                                $hours = round( ( $seconds - $days * 86400 ) / 3600 );
                                if ( $hours == 24 ) {
                                        $hours = 0;
index 4edce3d..eeec665 100644 (file)
@@ -290,7 +290,7 @@ $magicWords = [
        'defaultsort'             => [ 1, 'পূর্বনির্ধারিত_বাছাই', 'পূর্বনির্ধারিতবাছাই', 'DEFAULTSORT:', 'DEFAULTSORTKEY:', 'DEFAULTCATEGORYSORT:' ],
        'filepath'                => [ 0, 'ফাইলের_পথ:', 'ফাইলেরপথ:', 'FILEPATH:' ],
        'tag'                     => [ 0, 'ট্যাগ', 'tag' ],
-       'hiddencat'               => [ 1, '__লà§\81à¦\95ায়িতবিষয়শà§\8dরà§\87ণà§\80__', '__লà§\81à¦\95à§\8dà¦\95ায়িতবিষয়শ্রেণী__', '__HIDDENCAT__' ],
+       'hiddencat'               => [ 1, '__লà§\81à¦\95ানà§\8b_বিষয়শà§\8dরà§\87ণà§\80__', '__লà§\81à¦\95ানà§\8bবিষয়শà§\8dরà§\87ণà§\80__', '__লà§\81à¦\95ায়িতবিষয়শà§\8dরà§\87ণà§\80__', '__লà§\81à¦\95à§\8dà¦\95ায়িতবিষয়শà§\8dরà§\87ণà§\80__', '__লà§\81à¦\95à§\8dà¦\95ায়িত_বিষয়শ্রেণী__', '__HIDDENCAT__' ],
        'pagesincategory'         => [ 1, 'বিষয়শ্রেণীতেপাতা', 'বিষয়শ্রেণীতেপৃষ্ঠা', 'বিষয়শ্রেণীতে_পাতা', 'বিষয়শ্রেণীতে_পৃষ্ঠা', 'PAGESINCATEGORY', 'PAGESINCAT' ],
        'pagesize'                => [ 1, 'পাতার_আকার', 'পাতারআকার', 'পৃষ্ঠার_আকার', 'পৃষ্ঠারআকার', 'PAGESIZE' ],
        'index'                   => [ 1, '__নির্ঘণ্ট__', '__INDEX__' ],
index aeeae11..c90e988 100644 (file)
@@ -366,7 +366,6 @@ class UserTest extends MediaWikiTestCase {
         *      - ensure the password is not the same as the username
         *      - ensure the username/password combo isn't forbidden
         * @covers User::checkPasswordValidity()
-        * @covers User::getPasswordValidity()
         * @covers User::isValidPassword()
         */
        public function testCheckPasswordValidity() {
@@ -394,7 +393,6 @@ class UserTest extends MediaWikiTestCase {
                                ],
                        ],
                ] );
-               $this->hideDeprecated( 'User::getPasswordValidity' );
 
                $user = static::getTestUser()->getUser();
 
@@ -405,24 +403,20 @@ class UserTest extends MediaWikiTestCase {
                $this->assertFalse( $user->isValidPassword( 'a' ) );
                $this->assertFalse( $user->checkPasswordValidity( 'a' )->isGood() );
                $this->assertTrue( $user->checkPasswordValidity( 'a' )->isOK() );
-               $this->assertEquals( 'passwordtooshort', $user->getPasswordValidity( 'a' ) );
 
                // Maximum length
                $longPass = str_repeat( 'a', 41 );
                $this->assertFalse( $user->isValidPassword( $longPass ) );
                $this->assertFalse( $user->checkPasswordValidity( $longPass )->isGood() );
                $this->assertFalse( $user->checkPasswordValidity( $longPass )->isOK() );
-               $this->assertEquals( 'passwordtoolong', $user->getPasswordValidity( $longPass ) );
 
                // Matches username
                $this->assertFalse( $user->checkPasswordValidity( $user->getName() )->isGood() );
                $this->assertTrue( $user->checkPasswordValidity( $user->getName() )->isOK() );
-               $this->assertEquals( 'password-name-match', $user->getPasswordValidity( $user->getName() ) );
 
                // On the forbidden list
                $user = User::newFromName( 'Useruser' );
                $this->assertFalse( $user->checkPasswordValidity( 'Passpass' )->isGood() );
-               $this->assertEquals( 'password-login-forbidden', $user->getPasswordValidity( 'Passpass' ) );
        }
 
        /**
index b9b8306..2f6fa39 100644 (file)
@@ -135,6 +135,18 @@ class LanguageTest extends LanguageClassesTestCase {
                                '48 hours 0 minutes',
                                'formatTimePeriod() rounding (=48h), avoidseconds'
                        ],
+                       [
+                               259199.55,
+                               'avoidhours',
+                               '3 d',
+                               'formatTimePeriod() rounding (>48h), avoidhours'
+                       ],
+                       [
+                               259199.55,
+                               [ 'avoid' => 'avoidhours', 'noabbrevs' => true ],
+                               '3 days',
+                               'formatTimePeriod() rounding (>48h), avoidhours'
+                       ],
                        [
                                259199.55,
                                'avoidminutes',