From 1c97b1fb41b7e3f4d6d0aaee71d1a7d87a979015 Mon Sep 17 00:00:00 2001 From: Pavel Astakhov Date: Tue, 21 Jul 2015 16:47:05 +0600 Subject: [PATCH] tiny optimization Title::isValidRedirectTarget() Not special page cannot be invalid redirect target Change-Id: Ie8cc0c9717963472bdaf5b9d143938bd05bef6ba --- includes/Title.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 477373a4f6..4530f43a38 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -4823,15 +4823,17 @@ class Title { public function isValidRedirectTarget() { global $wgInvalidRedirectTargets; - // invalid redirect targets are stored in a global array, but explicitly disallow Userlogout here - if ( $this->isSpecial( 'Userlogout' ) ) { - return false; - } - - foreach ( $wgInvalidRedirectTargets as $target ) { - if ( $this->isSpecial( $target ) ) { + if ( $this->isSpecialPage() ) { + // invalid redirect targets are stored in a global array, but explicitly disallow Userlogout here + if ( $this->isSpecial( 'Userlogout' ) ) { return false; } + + foreach ( $wgInvalidRedirectTargets as $target ) { + if ( $this->isSpecial( $target ) ) { + return false; + } + } } return true; -- 2.20.1