From ec1714baeec7d7040ea2aa5155d31e27c506de97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 28 Sep 2010 08:16:42 +0000 Subject: [PATCH] Don't show empty source code for non-existing pages if editing was prevented by a permission error --- includes/EditPage.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 50d97fde5b..773f969b16 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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. -- 2.20.1