Don't show empty source code for non-existing pages if editing was prevented by a...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 28 Sep 2010 08:16:42 +0000 (08:16 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Tue, 28 Sep 2010 08:16:42 +0000 (08:16 +0000)
includes/EditPage.php

index 50d97fd..773f969 100644 (file)
@@ -330,7 +330,9 @@ class EditPage {
                $permErrors = $this->getEditPermissionErrors();
                if ( $permErrors ) {
                        wfDebug( __METHOD__ . ": User can't edit\n" );
-                       $this->readOnlyPage( $this->getContent( false ), true, $permErrors, 'edit' );
+                       $content = $this->getContent( null );
+                       $content = $content === '' ? null : $content;
+                       $this->readOnlyPage( $content, true, $permErrors, 'edit' );
                        wfProfileOut( __METHOD__ );
                        return;
                } else {
@@ -1173,7 +1175,7 @@ class EditPage {
         *                      parameter; will be called during form output
         *                      near the top, for captchas and the like.
         */
-       function showEditForm( $formCallback=null ) {
+       function showEditForm( $formCallback = null ) {
                global $wgOut, $wgUser, $wgTitle;
 
                # If $wgTitle is null, that means we're in API mode.