Merge "mediawiki.action.edit.preview: Disable if there is no #wpTextbox1"
[lhc/web/wiklou.git] / includes / specials / SpecialDiff.php
index bc0d7e3..799e526 100644 (file)
@@ -46,13 +46,14 @@ 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];
                        $this->mAddedRedirectParams['diff'] = $parts[1];
                } else {
                        // Wrong number of parameters, bail out
+                       $this->getOutput()->addHelpLink( 'Help:Diff' );
                        throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
                }