Jackmcbarn has uploaded a new change for review.

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

Change subject: Don't test against redirect targets
......................................................................

Don't test against redirect targets

There was never any use-case given for this, nor was there a bug report
about it, and it doesn't seem useful in any way, so remove it. Also, add
comments so that it's obvious when grepping that the messages aren't
unused now.

Change-Id: I80079fb4822fbc4f47df592119b1b1f8a367927c
---
M TitleBlacklist.hooks.php
M TitleBlacklist.list.php
2 files changed, 3 insertions(+), 17 deletions(-)


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

diff --git a/TitleBlacklist.hooks.php b/TitleBlacklist.hooks.php
index 78379a3..936a38b 100644
--- a/TitleBlacklist.hooks.php
+++ b/TitleBlacklist.hooks.php
@@ -155,23 +155,6 @@
                                Html::element( 'br', array( 'clear' => 'all' ) 
) . "\n";
 
                        // $error will be displayed by the edit class
-                       return true;
-               } elseif ( !$section ) {
-                       # Block redirects to nonexistent blacklisted titles
-                       $retitle = Title::newFromRedirect( $text );
-                       if ( $retitle !== null && !$retitle->exists() )  {
-                               $blacklisted = 
TitleBlacklist::singleton()->userCannot( $retitle, $wgUser, 'create' );
-                               if ( $blacklisted instanceof 
TitleBlacklistEntry ) {
-                                       $error = Html::openElement( 'div', 
array( 'class' => 'errorbox' ) ) .
-                                               wfMessage( 
'titleblacklist-forbidden-edit',
-                                                       $blacklisted->getRaw(),
-                                                       $retitle->getFullText() 
)->escaped() .
-                                               Html::closeElement( 'div' ) . 
"\n" .
-                                               Html::element( 'br', array( 
'clear' => 'all' ) ) . "\n";
-                               }
-                       }
-
-                       return true;
                }
                return true;
        }
diff --git a/TitleBlacklist.list.php b/TitleBlacklist.list.php
index 3947e8a..b903c04 100644
--- a/TitleBlacklist.list.php
+++ b/TitleBlacklist.list.php
@@ -528,6 +528,9 @@
         */
        public function getErrorMessage( $operation ) {
                $message = $this->getCustomMessage();
+               // For grep:
+               // titleblacklist-forbidden-edit, titleblacklist-forbidden-move,
+               // titleblacklist-forbidden-upload, 
titleblacklist-forbidden-new-account
                return $message ? $message : 
"titleblacklist-forbidden-{$operation}";
        }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80079fb4822fbc4f47df592119b1b1f8a367927c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TitleBlacklist
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn <jackmcb...@gmail.com>

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

Reply via email to