From: Sorawee Porncharoenwase Date: Sat, 22 Feb 2014 16:05:38 +0000 (+0000) Subject: Prevent Special:Diff from processing empty string X-Git-Tag: 1.31.0-rc.0~16852 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=1e4d675b16cf04d6f1f464936eb525a6796fb27a;p=lhc%2Fweb%2Fwiklou.git Prevent Special:Diff from processing empty string Umherirrender found that I77fdaf8e has a flaw. Currently it is possible to go to index.php?title=Special:Diff (without any trailing string), and the page will be redirected to index.php?diff= which is the last diff of the main page. However, the intended way to deal with this case is to raise ErrorPageError. This patch fixes the problem. Change-Id: I3ff0b11671f27e77d9068930338ec8bbb674a89f --- diff --git a/includes/specials/SpecialDiff.php b/includes/specials/SpecialDiff.php index bc0d7e3b85..77d23173ca 100644 --- a/includes/specials/SpecialDiff.php +++ b/includes/specials/SpecialDiff.php @@ -46,7 +46,7 @@ class SpecialDiff extends RedirectSpecialPage { $parts = explode( '/', $subpage ); // Try to parse the values given, generating somewhat pretty URLs if possible - if ( count( $parts ) === 1 ) { + if ( count( $parts ) === 1 && $parts[0] !== '' ) { $this->mAddedRedirectParams['diff'] = $parts[0]; } elseif ( count( $parts ) === 2 ) { $this->mAddedRedirectParams['oldid'] = $parts[0];