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
$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];