bug 32086 Special:Permanentlink require a parameter
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Nov 2011 14:21:42 +0000 (14:21 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Nov 2011 14:21:42 +0000 (14:21 +0000)
When Special:Permanentlink was not given any parameter it assumed oldid=0
and redirected to the Main_Page. This make it throw an error page instead.

RELEASE-NOTES-1.18
includes/SpecialPage.php

index 9766822..4e17e2b 100644 (file)
@@ -476,6 +476,8 @@ create a page or new section.
 * (bug 31674) Can't edit watchlist if it contains special pages
 * (bug 32100) Installer complains about Suhosin GET limit even if it is
   already set above 1024 bytes
+* (bug 32086) Special:PermanentLink now show an error message when no subpage
+  was specified.
 
 === API changes in 1.18 ===
 * BREAKING CHANGE: action=watch now requires POST and token.
index 7428e58..b033c9d 100644 (file)
@@ -1080,6 +1080,10 @@ class SpecialPermanentLink extends RedirectSpecialPage {
 
        function getRedirect( $subpage ) {
                $subpage = intval( $subpage );
+               if( $subpage === 0 ) {
+                       # throw an error page when no subpage was given
+                       throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
+               }
                $this->mAddedRedirectParams['oldid'] = $subpage;
                return true;
        }