Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/273586

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TitleBlacklist 
refs/changes/86/273586/1

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: newchange
Gerrit-Change-Id: I8fe7f03d68e6854106cc903baf7c14ba4badb7c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TitleBlacklist
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

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

Reply via email to