Florianschmidtwelzow has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372763 )

Change subject: AuthManager: Consistent behavior of read-only reason on 
Special:CreateAccount
......................................................................

AuthManager: Consistent behavior of read-only reason on Special:CreateAccount

Before this commit, the reason set in the global $wgReadOnly was differently 
handled
on different special pages. While on most of them, like Special:Upload, the 
reason
is allowed to have HTML, which can be used in Wikitext, too, 
Special:CreateAccount
always outputted an escaped version of this reason.

Most special pages uses the ReadOnlyError exception to print a read-only error,
however, AuthManager uses Status objects to communicate between the backend and 
the
frontend. Therefore the same message and parameters were wrapped in a Status 
object
and, in the frontend, directly passed to the constructor of ErrorPageError. 
Unfortunately,
Status::getMessage() escapes the parameters of a message, which is the reason, 
why the
wiki is read-only. To bypass this restriction, AuthManager now creates a 
Message object
directly, does not escape the reason, and uses the resulting object to create a 
Status
object from.

Now the reason is not escaped on Special:CreateAccount anymore, like on most 
other
special pages.

Bug: T157036
Change-Id: Idbfe556fcb90f8bda8fae9d728ca9dee5ea02f67
---
M includes/auth/AuthManager.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/372763/1

diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php
index c3f798f..a242536 100644
--- a/includes/auth/AuthManager.php
+++ b/includes/auth/AuthManager.php
@@ -975,7 +975,7 @@
        public function checkAccountCreatePermissions( User $creator ) {
                // Wiki is read-only?
                if ( wfReadOnly() ) {
-                       return Status::newFatal( 'readonlytext', 
wfReadOnlyReason() );
+                       return Status::newFatal( wfMessage( 'readonlytext', 
wfReadOnlyReason() ) );
                }
 
                // This is awful, this permission check really shouldn't go 
through Title.

-- 
To view, visit https://gerrit.wikimedia.org/r/372763
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbfe556fcb90f8bda8fae9d728ca9dee5ea02f67
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to