From: jenkins-bot Date: Wed, 6 Mar 2019 15:11:07 +0000 (+0000) Subject: Merge "Hard deprecate MWNamespace::canTalk()" X-Git-Tag: 1.34.0-rc.0~2636 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=7110e89e542f972bc148ece238829f00fb2e1053;hp=ab4feff3ca31a11ee8d1fbcd49941c13c4d9ac31;p=lhc%2Fweb%2Fwiklou.git Merge "Hard deprecate MWNamespace::canTalk()" --- diff --git a/.fresnel.yml b/.fresnel.yml index 5b7e0f22d5..e6942949ce 100644 --- a/.fresnel.yml +++ b/.fresnel.yml @@ -1,12 +1,12 @@ warmup: true runs: 5 scenarios: - # Load a page view - # The only page that exists by default is the main page. - # But, its actual name is configurable/unknown (T216791). - # Omit 'title' to let MediaWiki show the defaul (which is the main page), - # and a query string to prevent the normalization redirect. - - url: "{MW_SERVER}{MW_SCRIPT_PATH}/index.php?noredirectplz" + Load a page: + # The only page that exists by default is the main page. + # But, its actual name is configurable/unknown (T216791). + # Omit 'title' to let MediaWiki show the defaul (which is the main page), + # and a query string to prevent a normalization redirect. + url: "{MW_SERVER}{MW_SCRIPT_PATH}/index.php?noredirectplz" viewport: width: 1100 height: 700 @@ -17,8 +17,8 @@ scenarios: probes: - screenshot - trace - # Load an 'edit' form - - url: "{MW_SERVER}{MW_SCRIPT_PATH}/index.php?action=edit" + Load the editor: + url: "{MW_SERVER}{MW_SCRIPT_PATH}/index.php?action=edit" viewport: width: 1100 height: 700 @@ -29,8 +29,8 @@ scenarios: probes: - screenshot - trace - # View recent changes - - url: "{MW_SERVER}{MW_SCRIPT_PATH}/index.php?title=Special:RecentChanges" + View recent changes: + url: "{MW_SERVER}{MW_SCRIPT_PATH}/index.php?title=Special:RecentChanges" viewport: width: 1100 height: 700 diff --git a/.phpcs.xml b/.phpcs.xml index 99afa3bfd4..b877c96647 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -13,7 +13,6 @@ - @@ -101,7 +100,6 @@ */includes/specials/SpecialMostlinkedtemplates\.php */includes/specials/SpecialMostrevisions\.php */includes/specials/SpecialMovepage\.php - */includes/specials/SpecialMyRedirectPages\.php */includes/specials/SpecialNewimages\.php */includes/specials/SpecialRandompage\.php */includes/specials/SpecialShortpages\.php @@ -215,7 +213,6 @@ */includes/api/ApiMessage\.php */includes/api/ApiOpenSearch\.php */includes/api/ApiRsd\.php - */includes/AuthPlugin\.php */includes/cache/CacheDependency\.php */includes/compat/XMPReader\.php */includes/diff/DairikiDiff\.php @@ -243,14 +240,10 @@ */includes/RevisionList\.php */includes/search/SearchEngine\.php */includes/specialpage/LoginSignupSpecialPage\.php - */includes/specialpage/RedirectSpecialPage\.php */includes/specials/forms/PreferencesFormLegacy\.php - */includes/specials/SpecialListusers\.php - */includes/specials/SpecialMyRedirectPages\.php */includes/StubObject\.php */includes/upload/UploadStash\.php */includes/utils/AutoloadGenerator\.php - */includes/WebResponse\.php */maintenance/dumpIterator\.php */maintenance/Maintenance\.php */maintenance/findDeprecated\.php diff --git a/HISTORY b/HISTORY index 72ff437a88..a9260699fb 100644 --- a/HISTORY +++ b/HISTORY @@ -522,8 +522,8 @@ because of Phabricator reports. * SearchResult::setExtensionData argument has been changed from accepting an array to accepting a Closure that returns the array when called. * Class CryptRand, everything in MWCryptRand except generateHex() and function - MediaWikiServices::getCryptRand() are deprecated, use random_bytes() to - generate cryptographically secure random byte sequences. + MediaWikiServices::getInstance()->getCryptRand() are deprecated, use + random_bytes() to generate cryptographically secure random byte sequences. * Parser::getConverterLanguage() is deprecated. Use ::getTargetLanguage() instead. * Language::markNoConversion() is deprecated. It confused readers because @@ -590,10 +590,12 @@ because of Phabricator reports. * All MagicWord static methods are now deprecated. Use the MagicWordFactory methods instead. * PasswordFactory::init is deprecated. To get a password factory with the - standard configuration, use MediaWikiServices::getPasswordFactory. -* $wgContLang is deprecated, use MediaWikiServices::getContentLanguage() + standard configuration, use + MediaWikiServices::getInstance()->getPasswordFactory. +* $wgContLang is deprecated, use + MediaWikiServices::getInstance()->getContentLanguage() instead. +* $wgParser is deprecated, use MediaWikiServices::getInstance()->getParser() instead. -* $wgParser is deprecated, use MediaWikiServices::getParser() instead. * wfGetMainCache() is deprecated, use ObjectCache::getLocalClusterInstance() instead. * wfGetCache() is deprecated, use ObjectCache::getInstance() instead. diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index 4a923c52b4..c2bb4cfb62 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -41,6 +41,8 @@ production. set `$wgParserCacheType = CACHE_NONE;` instead. * $wgCommentTableSchemaMigrationStage has been removed. Extension code finding it unset should treat it as being MIGRATION_NEW. +* $wgAuth – This old setting, deprecated in 1.27, has been removed as part of + the removal of AuthPlugin. === New features in 1.33 === * (T96041) __EXPECTUNUSEDCATEGORY__ on a category page causes the category @@ -122,6 +124,8 @@ production. passed a bad code. * ApiBase::checkTitleUserPermissions() now takes an options array as its third parameter. Passing a User object or null is deprecated. +* The api-feature-usage log channel now has log context. The text message is + deprecated and will be removed in the future. === Languages updated in 1.33 === MediaWiki supports over 350 languages. Many localisations are updated regularly. @@ -265,6 +269,16 @@ because of Phabricator reports. * MessageBlobStore::__construct() now requires its $rl parameter. * Second parameter to Sanitizer::escapeIdReferenceList() (deprecated in 1.31) has been removed. +* The 'jquery.xmldom' module has been removed. +* The 'jquery.mockjax' module has been removed. +* The 'jquery.hidpi' module, deprecated in 1.32, has been removed. +* AuthPlugin and related code, deprecated in 1.27, has been removed. Extensions + should instead use AuthManager. The following no longer exist: + * The AuthPlugin class itself and the related AuthPluginUser class and i18n + * The AuthPluginSetup and AuthPluginAutoCreate hooks + * The transitional wrapper classes AuthPluginPrimaryAuthenticationProvider, + AuthManagerAuthPlugin, and AuthManagerAuthPluginUser. + * The $wgAuth configuration setting and its use in Setup.php and unit tests === Deprecations in 1.33 === * The configuration option $wgUseESI has been deprecated, and is expected @@ -321,6 +335,8 @@ because of Phabricator reports. Block::isCreateAccountBlocked and Block::isUsertalkEditAllowed to get and set block properties; use Block::appliesToRight and Block::appliesToUsertalk to check block behaviour. +* The api-feature-usage log channel now has log context. The text message is + deprecated and will be removed in the future. === Other changes in 1.33 === * (T201747) Html::openElement() warns if given an element name with a space diff --git a/autoload.php b/autoload.php index aaf6f51c33..fab10fe5d2 100644 --- a/autoload.php +++ b/autoload.php @@ -166,8 +166,6 @@ $wgAutoloadLocalClasses = [ 'AttachLatest' => __DIR__ . '/maintenance/attachLatest.php', 'AugmentPageProps' => __DIR__ . '/includes/search/AugmentPageProps.php', 'AuthManagerSpecialPage' => __DIR__ . '/includes/specialpage/AuthManagerSpecialPage.php', - 'AuthPlugin' => __DIR__ . '/includes/AuthPlugin.php', - 'AuthPluginUser' => __DIR__ . '/includes/AuthPlugin.php', 'AutoCommitUpdate' => __DIR__ . '/includes/deferred/AutoCommitUpdate.php', 'AutoLoader' => __DIR__ . '/includes/AutoLoader.php', 'AutoloadGenerator' => __DIR__ . '/includes/utils/AutoloadGenerator.php', @@ -498,7 +496,7 @@ $wgAutoloadLocalClasses = [ 'FakeResultWrapper' => __DIR__ . '/includes/libs/rdbms/database/resultwrapper/FakeResultWrapper.php', 'FatalError' => __DIR__ . '/includes/exception/FatalError.php', 'FauxRequest' => __DIR__ . '/includes/FauxRequest.php', - 'FauxResponse' => __DIR__ . '/includes/WebResponse.php', + 'FauxResponse' => __DIR__ . '/includes/FauxResponse.php', 'FeedItem' => __DIR__ . '/includes/Feed.php', 'FeedUtils' => __DIR__ . '/includes/FeedUtils.php', 'FetchText' => __DIR__ . '/maintenance/fetchText.php', @@ -1205,7 +1203,7 @@ $wgAutoloadLocalClasses = [ 'RecentChangesUpdateJob' => __DIR__ . '/includes/jobqueue/jobs/RecentChangesUpdateJob.php', 'RecompressTracked' => __DIR__ . '/maintenance/storage/recompressTracked.php', 'RecountCategories' => __DIR__ . '/maintenance/recountCategories.php', - 'RedirectSpecialArticle' => __DIR__ . '/includes/specialpage/RedirectSpecialPage.php', + 'RedirectSpecialArticle' => __DIR__ . '/includes/specialpage/RedirectSpecialArticle.php', 'RedirectSpecialPage' => __DIR__ . '/includes/specialpage/RedirectSpecialPage.php', 'RedisBagOStuff' => __DIR__ . '/includes/libs/objectcache/RedisBagOStuff.php', 'RedisConnRef' => __DIR__ . '/includes/libs/redis/RedisConnRef.php', @@ -1349,7 +1347,7 @@ $wgAutoloadLocalClasses = [ 'SlotDiffRenderer' => __DIR__ . '/includes/diff/SlotDiffRenderer.php', 'SpecialActiveUsers' => __DIR__ . '/includes/specials/SpecialActiveusers.php', 'SpecialAllMessages' => __DIR__ . '/includes/specials/SpecialAllMessages.php', - 'SpecialAllMyUploads' => __DIR__ . '/includes/specials/SpecialMyRedirectPages.php', + 'SpecialAllMyUploads' => __DIR__ . '/includes/specials/redirects/SpecialAllMyUploads.php', 'SpecialAllPages' => __DIR__ . '/includes/specials/SpecialAllPages.php', 'SpecialApiHelp' => __DIR__ . '/includes/specials/SpecialApiHelp.php', 'SpecialApiSandbox' => __DIR__ . '/includes/specials/SpecialApiSandbox.php', @@ -1379,8 +1377,8 @@ $wgAutoloadLocalClasses = [ 'SpecialImport' => __DIR__ . '/includes/specials/SpecialImport.php', 'SpecialJavaScriptTest' => __DIR__ . '/includes/specials/SpecialJavaScriptTest.php', 'SpecialLinkAccounts' => __DIR__ . '/includes/specials/SpecialLinkAccounts.php', - 'SpecialListAdmins' => __DIR__ . '/includes/specials/SpecialListusers.php', - 'SpecialListBots' => __DIR__ . '/includes/specials/SpecialListusers.php', + 'SpecialListAdmins' => __DIR__ . '/includes/specials/redirects/SpecialListAdmins.php', + 'SpecialListBots' => __DIR__ . '/includes/specials/redirects/SpecialListBots.php', 'SpecialListFiles' => __DIR__ . '/includes/specials/SpecialListfiles.php', 'SpecialListGrants' => __DIR__ . '/includes/specials/SpecialListgrants.php', 'SpecialListGroupRights' => __DIR__ . '/includes/specials/SpecialListgrouprights.php', @@ -1389,10 +1387,10 @@ $wgAutoloadLocalClasses = [ 'SpecialLog' => __DIR__ . '/includes/specials/SpecialLog.php', 'SpecialMergeHistory' => __DIR__ . '/includes/specials/SpecialMergeHistory.php', 'SpecialMyLanguage' => __DIR__ . '/includes/specials/SpecialMyLanguage.php', - 'SpecialMycontributions' => __DIR__ . '/includes/specials/SpecialMyRedirectPages.php', - 'SpecialMypage' => __DIR__ . '/includes/specials/SpecialMyRedirectPages.php', - 'SpecialMytalk' => __DIR__ . '/includes/specials/SpecialMyRedirectPages.php', - 'SpecialMyuploads' => __DIR__ . '/includes/specials/SpecialMyRedirectPages.php', + 'SpecialMycontributions' => __DIR__ . '/includes/specials/redirects/SpecialMycontributions.php', + 'SpecialMypage' => __DIR__ . '/includes/specials/redirects/SpecialMypage.php', + 'SpecialMytalk' => __DIR__ . '/includes/specials/redirects/SpecialMytalk.php', + 'SpecialMyuploads' => __DIR__ . '/includes/specials/redirects/SpecialMyuploads.php', 'SpecialNewFiles' => __DIR__ . '/includes/specials/SpecialNewimages.php', 'SpecialNewpages' => __DIR__ . '/includes/specials/SpecialNewpages.php', 'SpecialPage' => __DIR__ . '/includes/specialpage/SpecialPage.php', @@ -1414,7 +1412,7 @@ $wgAutoloadLocalClasses = [ 'SpecialRecentChanges' => __DIR__ . '/includes/specials/SpecialRecentchanges.php', 'SpecialRecentChangesLinked' => __DIR__ . '/includes/specials/SpecialRecentchangeslinked.php', 'SpecialRedirect' => __DIR__ . '/includes/specials/SpecialRedirect.php', - 'SpecialRedirectToSpecial' => __DIR__ . '/includes/specialpage/RedirectSpecialPage.php', + 'SpecialRedirectToSpecial' => __DIR__ . '/includes/specialpage/SpecialRedirectToSpecial.php', 'SpecialRemoveCredentials' => __DIR__ . '/includes/specials/SpecialRemoveCredentials.php', 'SpecialResetTokens' => __DIR__ . '/includes/specials/SpecialResetTokens.php', 'SpecialRevisionDelete' => __DIR__ . '/includes/specials/SpecialRevisiondelete.php', diff --git a/docs/hooks.txt b/docs/hooks.txt index 8b5e4d7a70..ae4a4dce90 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -787,16 +787,6 @@ $extraData: An array (string => string) with extra information, intended to be added to log contexts. Fields it might include: - appId: the application ID, only if the login was with a bot password -'AuthPluginAutoCreate': DEPRECATED since 1.27! Use the 'LocalUserCreated' hook -instead. Called when creating a local account for an user logged in from an -external authentication method. -$user: User object created locally - -'AuthPluginSetup': DEPRECATED since 1.27! Extensions should be updated to use -AuthManager. Update or replace authentication plugin object ($wgAuth). Gives a -chance for an extension to set it programmatically to a variable class. -&$auth: the $wgAuth object, probably a stub - 'AutopromoteCondition': Check autopromote condition for user. $type: condition type $args: arguments @@ -3837,6 +3827,23 @@ the database) have been saved. Compare to the UserSaveOptions hook, which is called before. $user: The User for which the options have been saved +'UserSendConfirmationMail': Called just before a confirmation email is sent to +a user. Hook handlers can modify the email that will be sent. +$user: The User for which the confirmation email is going to be sent +&$mail: Associative array describing the email, with the following keys: + - subject: Subject line of the email + - body: Email body. Can be a string, or an array with keys 'text' and 'html' + - from: User object, or null meaning $wgPasswordSender will be used + - replyTo: MailAddress object or null +$info: Associative array with additional information: + - type: 'created' if the user's account was just created; 'set' if the user + set an email address when they previously didn't have one; 'changed' if + the user had an email address and changed it + - ip: The IP address from which the user set/changed their email address + - confirmURL: URL the user should visit to confirm their email + - invalidateURL: URL the user should visit to invalidate confirmURL + - expiration: time and date when confirmURL expires + 'UserSetCookies': DEPRECATED since 1.27! If you're trying to replace core session cookie handling, you want to create a subclass of MediaWiki\Session\CookieSessionProvider instead. Otherwise, you can no longer diff --git a/docs/injection.txt b/docs/injection.txt index 2badea98cb..83a14c730d 100644 --- a/docs/injection.txt +++ b/docs/injection.txt @@ -219,7 +219,7 @@ already known to MediaWikiServices (if not, see above). variables. * Add a constructor to MyExtHooks that takes a Bar service as a parameter. * Add a static method called newFromGlobalState() with no parameters. It should - just return new MyExtHooks( MediaWikiServices::getBar() ). + just return new MyExtHooks( MediaWikiServices::getInstance()->getBar() ). * The original static handler method onFoo( $x ) is then implemented as self::newFromGlobalState()->doFoo( $x ). diff --git a/docs/ontology.owl b/docs/ontology.owl index 19476a35f2..998292cadb 100644 --- a/docs/ontology.owl +++ b/docs/ontology.owl @@ -1,6 +1,7 @@ @@ -13,11 +14,13 @@ xmlns:rdf="&rdf;" xmlns:rdfs="&rdfs;" xmlns:owl="&owl;" + xmlns:cc="&cc;" > MediaWiki ontology The ontology of MediaWiki + Special:ListUsers/sysop. - * - * @ingroup SpecialPage - */ -class SpecialListAdmins extends SpecialRedirectToSpecial { - function __construct() { - parent::__construct( 'Listadmins', 'Listusers', 'sysop' ); - } -} - -/** - * Redirect page: Special:ListBots --> Special:ListUsers/bot. - * - * @ingroup SpecialPage - */ -class SpecialListBots extends SpecialRedirectToSpecial { - function __construct() { - parent::__construct( 'Listbots', 'Listusers', 'bot' ); - } -} diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index 4d50642f0c..21c166c65d 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -38,7 +38,9 @@ class SpecialLog extends SpecialPage { $this->setHeaders(); $this->outputHeader(); - $this->getOutput()->addModules( 'mediawiki.userSuggest' ); + $out = $this->getOutput(); + $out->addModules( 'mediawiki.userSuggest' ); + $out->addModuleStyles( 'mediawiki.interface.helpers.styles' ); $this->addHelpLink( 'Help:Log' ); $opts = new FormOptions; diff --git a/includes/specials/SpecialMyRedirectPages.php b/includes/specials/SpecialMyRedirectPages.php deleted file mode 100644 index 077fbf1547..0000000000 --- a/includes/specials/SpecialMyRedirectPages.php +++ /dev/null @@ -1,185 +0,0 @@ -getUser()->getName() ); - } - - return Title::makeTitle( NS_USER, $this->getUser()->getName() . '/' . $subpage ); - } - - /** - * Target identifies a specific User. See T109724. - * - * @since 1.27 - * @return bool - */ - public function personallyIdentifiableTarget() { - return true; - } -} - -/** - * Special page pointing to current user's talk page. - * - * @ingroup SpecialPage - */ -class SpecialMytalk extends RedirectSpecialArticle { - public function __construct() { - parent::__construct( 'Mytalk' ); - } - - /** - * @param string|null $subpage - * @return Title - */ - public function getRedirect( $subpage ) { - if ( $subpage === null || $subpage === '' ) { - return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() ); - } - - return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() . '/' . $subpage ); - } - - /** - * Target identifies a specific User. See T109724. - * - * @since 1.27 - * @return bool - */ - public function personallyIdentifiableTarget() { - return true; - } -} - -/** - * Special page pointing to current user's contributions. - * - * @ingroup SpecialPage - */ -class SpecialMycontributions extends RedirectSpecialPage { - public function __construct() { - parent::__construct( 'Mycontributions' ); - $this->mAllowedRedirectParams = [ 'limit', 'namespace', 'tagfilter', - 'offset', 'dir', 'year', 'month', 'feed', 'deletedOnly', - 'nsInvert', 'associated', 'newOnly', 'topOnly', 'start', 'end' ]; - } - - /** - * @param string|null $subpage - * @return Title - */ - public function getRedirect( $subpage ) { - return SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() ); - } - - /** - * Target identifies a specific User. See T109724. - * - * @since 1.27 - * @return bool - */ - public function personallyIdentifiableTarget() { - return true; - } -} - -/** - * Special page pointing to current user's uploaded files. - * - * @ingroup SpecialPage - */ -class SpecialMyuploads extends RedirectSpecialPage { - public function __construct() { - parent::__construct( 'Myuploads' ); - $this->mAllowedRedirectParams = [ 'limit', 'ilshowall', 'ilsearch' ]; - } - - /** - * @param string|null $subpage - * @return Title - */ - public function getRedirect( $subpage ) { - return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() ); - } - - /** - * Target identifies a specific User. See T109724. - * - * @since 1.27 - * @return bool - */ - public function personallyIdentifiableTarget() { - return true; - } -} - -/** - * Special page pointing to current user's uploaded files (including old versions). - * - * @ingroup SpecialPage - */ -class SpecialAllMyUploads extends RedirectSpecialPage { - public function __construct() { - parent::__construct( 'AllMyUploads' ); - $this->mAllowedRedirectParams = [ 'limit', 'ilsearch' ]; - } - - /** - * @param string|null $subpage - * @return Title - */ - public function getRedirect( $subpage ) { - $this->mAddedRedirectParams['ilshowall'] = 1; - - return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() ); - } - - /** - * Target identifies a specific User. See T109724. - * - * @since 1.27 - * @return bool - */ - public function personallyIdentifiableTarget() { - return true; - } -} diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 2bbc0bf486..1f81cf0a6d 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -40,7 +40,6 @@ class SpecialNewpages extends IncludableSpecialPage { } protected function setup( $par ) { - // Options $opts = new FormOptions(); $this->opts = $opts; // bind $opts->add( 'hideliu', false ); @@ -63,13 +62,11 @@ class SpecialNewpages extends IncludableSpecialPage { $opts->add( $key, $params['default'] ); } - // Set values $opts->fetchValuesFromRequest( $this->getRequest() ); if ( $par ) { $this->parseParams( $par ); } - // Validate $opts->validateIntBounds( 'limit', 0, 5000 ); } diff --git a/includes/specials/SpecialPasswordPolicies.php b/includes/specials/SpecialPasswordPolicies.php index 573dcb52aa..d09deabf27 100644 --- a/includes/specials/SpecialPasswordPolicies.php +++ b/includes/specials/SpecialPasswordPolicies.php @@ -136,20 +136,37 @@ class SpecialPasswordPolicies extends SpecialPage { ); $ret = []; - foreach ( $groupPolicies as $gp => $val ) { - if ( $val === false ) { - // Policy isn't enabled, so no need to dislpay it + foreach ( $groupPolicies as $gp => $settings ) { + if ( !is_array( $settings ) ) { + $settings = [ 'value' => $settings ]; + } + $val = $settings['value']; + $flags = array_diff_key( $settings, [ 'value' => true ] ); + if ( !$val ) { + // Policy isn't enabled, so no need to display it continue; - } elseif ( $val === true ) { - $msg = $this->msg( 'passwordpolicies-policy-' . strtolower( $gp ) ); + } + $msg = $this->msg( 'passwordpolicies-policy-' . strtolower( $gp ) )->numParams( $val ); + $flagMsgs = []; + foreach ( array_filter( $flags ) as $flag => $value ) { + $flagMsg = $this->msg( 'passwordpolicies-policyflag-' . strtolower( $flag ) ); + $flagMsg->params( $value ); + $flagMsgs[] = $flagMsg; + } + if ( $flagMsgs ) { + $ret[] = $this->msg( + 'passwordpolicies-policy-displaywithflags', + $msg, + '' . $gp . '', + $this->getLanguage()->commaList( $flagMsgs ) + )->parse(); } else { - $msg = $this->msg( 'passwordpolicies-policy-' . strtolower( $gp ) )->numParams( $val ); + $ret[] = $this->msg( + 'passwordpolicies-policy-display', + $msg, + '' . $gp . '' + )->parse(); } - $ret[] = $this->msg( - 'passwordpolicies-policy-display', - $msg, - '' . $gp . '' - )->parse(); } if ( $ret === [] ) { return ''; diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 1e016a5f10..46b5520915 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -682,16 +682,21 @@ class SpecialRecentChanges extends ChangesListSpecialPage { [ 'name' => 'namespace', 'id' => 'namespace' ] ); $nsLabel = Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ); - $invert = Xml::checkLabel( + $attribs = [ 'class' => [ 'mw-input-with-label' ] ]; + // Hide the checkboxes when the namespace filter is set to 'all'. + if ( $opts['namespace'] === '' ) { + $attribs['class'][] = 'mw-input-hidden'; + } + $invert = Html::rawElement( 'span', $attribs, Xml::checkLabel( $this->msg( 'invert' )->text(), 'invert', 'nsinvert', $opts['invert'], [ 'title' => $this->msg( 'tooltip-invert' )->text() ] - ); - $associated = Xml::checkLabel( + ) ); + $associated = Html::rawElement( 'span', $attribs, Xml::checkLabel( $this->msg( 'namespace_association' )->text(), 'associated', 'nsassociated', $opts['associated'], [ 'title' => $this->msg( 'tooltip-namespace_association' )->text() ] - ); + ) ); return [ $nsLabel, "$nsSelect $invert $associated" ]; } @@ -912,7 +917,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage { 'span', [ 'class' => 'rclistfrom' ], $this->makeOptionsLink( - $this->msg( 'rclistfrom' )->rawParams( $now, $timenow, $datenow )->parse(), + $this->msg( 'rclistfrom' )->plaintextParams( $now, $timenow, $datenow )->parse(), [ 'from' => $timestamp ], $nondefaults ) diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index b462ce5d87..f0bac45ba3 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -418,7 +418,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { // Show form if the user can submit if ( $this->mIsAllowed ) { $out->addModules( [ 'mediawiki.special.revisionDelete' ] ); - $out->addModuleStyles( 'mediawiki.special' ); + $out->addModuleStyles( [ 'mediawiki.special', + 'mediawiki.interface.helpers.styles' ] ); $form = Xml::openElement( 'form', [ 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] ), diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index ec6c5b94c9..e6d06329ad 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -167,21 +167,7 @@ class SpecialSearch extends SpecialPage { $url = str_replace( '$1', urlencode( $term ), $searchForwardUrl ); $out->redirect( $url ); } else { - $out->addHTML( - "
" . - "" . - $this->msg( 'search-external' )->escaped() . - "" . - "

" . - $this->msg( 'searchdisabled' )->escaped() . - "

" . - $this->msg( 'googlesearch' )->rawParams( - htmlspecialchars( $term ), - 'UTF-8', - $this->msg( 'searchbutton' )->escaped() - )->text() . - "
" - ); + $this->showGoogleSearch( $term ); } return; @@ -190,6 +176,31 @@ class SpecialSearch extends SpecialPage { $this->showResults( $term ); } + /** + * Output a google search form if search is disabled + * + * @param string $term Search term + * @todo FIXME Maybe we should get rid of this raw html message at some future time + * @suppress SecurityCheck-XSS + */ + private function showGoogleSearch( $term ) { + $this->getOutput()->addHTML( + "
" . + "" . + $this->msg( 'search-external' )->escaped() . + "" . + "

" . + $this->msg( 'searchdisabled' )->escaped() . + "

" . + $this->msg( 'googlesearch' )->rawParams( + htmlspecialchars( $term ), + 'UTF-8', + $this->msg( 'searchbutton' )->escaped() + )->text() . + "
" + ); + } + /** * Set up basic search parameters from the request and user settings. * diff --git a/includes/specials/SpecialSpecialpages.php b/includes/specials/SpecialSpecialpages.php index 9de31da331..ee174ac60c 100644 --- a/includes/specials/SpecialSpecialpages.php +++ b/includes/specials/SpecialSpecialpages.php @@ -99,10 +99,18 @@ class SpecialSpecialpages extends UnlistedSpecialPage { $includesCachedPages = false; foreach ( $groups as $group => $sortedPages ) { - $out->wrapWikiMsg( - "

$1

\n", - "specialpages-group-$group" - ); + if ( strpos( $group, '/' ) !== false ) { + list( $group, $subGroup ) = explode( '/', $group, 2 ); + $out->wrapWikiMsg( + "

$1

\n", + "specialpages-group-$group-$subGroup" + ); + } else { + $out->wrapWikiMsg( + "

$1

\n", + "specialpages-group-$group" + ); + } $out->addHTML( Html::openElement( 'div', [ 'class' => 'mw-specialpages-list' ] ) . '