jenkins-bot has submitted this change and it was merged.

Change subject: Fix 'localpage' message handling
......................................................................


Fix 'localpage' message handling

It looks like the original implementation of this (r28307) was
incorrectly using wfEmptyMsg() so it was checking if the specified
message page had content equal to '<titleblacklist>' rather than
checking whether the message actually being loaded was empty.

Then r64178 changed wfEmptyMessage() such that it was checking if the
'titleblacklist' message was disabled in the user's language, which
caused the behavior here to be even more wrong. Then Ie78fa258 came
along to cement this in place and make this code even more
incomprehensible.

So let's go back to what it was probably originally trying to do: return
the 'localpage' message's content if it's not disabled, or empty string if
it is disabled.

This should also take care of T56193#2068536, which is being triggered
by the attempt to load the message in the user's language.

Bug: T56193
Change-Id: I8fe7f03d68e6854106cc903baf7c14ba4badb7c7
---
M TitleBlacklist.list.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/TitleBlacklist.list.php b/TitleBlacklist.list.php
index 489e87a..9772679 100755
--- a/TitleBlacklist.list.php
+++ b/TitleBlacklist.list.php
@@ -94,9 +94,9 @@
                                return '';
                        }
                        if ( $title->getNamespace() == NS_MEDIAWIKI ) {
-                               $msg = wfMessage( $title->getText() 
)->inContentLanguage()->text();
-                               if ( !wfMessage( 'titleblacklist', $msg 
)->isDisabled() ) {
-                                       return $msg;
+                               $msg = wfMessage( $title->getText() 
)->inContentLanguage();
+                               if ( !$msg->isDisabled() ) {
+                                       return $msg->text();
                                } else {
                                        return '';
                                }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8fe7f03d68e6854106cc903baf7c14ba4badb7c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TitleBlacklist
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to