From: Antoine Musso Date: Tue, 1 Nov 2011 14:21:42 +0000 (+0000) Subject: bug 32086 Special:Permanentlink require a parameter X-Git-Tag: 1.31.0-rc.0~26787 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=67f632f2557852cb747c915f83c0caa83aed648f;p=lhc%2Fweb%2Fwiklou.git bug 32086 Special:Permanentlink require a parameter 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. --- diff --git a/RELEASE-NOTES-1.18 b/RELEASE-NOTES-1.18 index 97668227f4..4e17e2b1fe 100644 --- a/RELEASE-NOTES-1.18 +++ b/RELEASE-NOTES-1.18 @@ -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. diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 7428e5873f..b033c9d884 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -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; }