http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73875

Revision: 73875
Author:   nikerabbit
Date:     2010-09-28 08:16:42 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
Don't show empty source code for non-existing pages if editing was prevented by 
a permission error

Modified Paths:
--------------
    trunk/phase3/includes/EditPage.php

Modified: trunk/phase3/includes/EditPage.php
===================================================================
--- trunk/phase3/includes/EditPage.php  2010-09-28 07:58:50 UTC (rev 73874)
+++ trunk/phase3/includes/EditPage.php  2010-09-28 08:16:42 UTC (rev 73875)
@@ -330,7 +330,9 @@
                $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 @@
         *                      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.



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to