X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecialpage%2FRedirectSpecialPage.php;h=8d39c996af843b3a3e499979a5ccb36ebe4d2da6;hb=d3538125dfe64afa94ef68aa000549a03eb49977;hp=9b5d5f463d495c07b390226567cd543866fa6159;hpb=3b24efab270e0f8d768ee3d390e25ae5259da431;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/RedirectSpecialPage.php b/includes/specialpage/RedirectSpecialPage.php index 9b5d5f463d..8d39c996af 100644 --- a/includes/specialpage/RedirectSpecialPage.php +++ b/includes/specialpage/RedirectSpecialPage.php @@ -35,6 +35,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { /** * @param string|null $subpage + * @return Title|bool */ public function execute( $subpage ) { $redirect = $this->getRedirect( $subpage ); @@ -52,8 +53,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { return $redirect; } else { - $class = static::class; - throw new MWException( "RedirectSpecialPage $class doesn't redirect!" ); + $this->showNoRedirectPage(); } } @@ -106,6 +106,11 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage { public function personallyIdentifiableTarget() { return false; } + + protected function showNoRedirectPage() { + $class = static::class; + throw new MWException( "RedirectSpecialPage $class doesn't redirect!" ); + } } /**