From 07a2fee8a82017d34f2c5120ce2f3863053003d9 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Fri, 25 Jan 2008 00:18:54 +0000 Subject: [PATCH] Revert 30130, completely breaks editing with fatal PHP error. --- includes/EditPage.php | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 749a63f9fb..ae4f408973 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -16,30 +16,30 @@ * usually the same, but they are now allowed to be different. */ class EditPage { - const AS_SUCCESS_UPDATE = 200; + const AS_SUCCESS_UPDATE = 200; const AS_SUCCESS_NEW_ARTICLE = 201; - const AS_HOOK_ERROR = 210; - const AS_FILTERING = 211; + const AS_HOOK_ERROR = 210; + const AS_FILTERING = 211; const AS_HOOK_ERROR_EXPECTED = 212; const AS_BLOCKED_PAGE_FOR_USER = 215; - const AS_CONTENT_TOO_BIG = 216; - const AS_USER_CANNOT_EDIT = 217; + const AS_CONTENT_TOO_BIG = 216; + const AS_USER_CANNOT_EDIT = 217; const AS_READ_ONLY_PAGE_ANON = 218; const AS_READ_ONLY_PAGE_LOGGED = 219; - const AS_READ_ONLY_PAGE = 220; - const AS_RATE_LIMITED = 221; + const AS_READ_ONLY_PAGE = 220; + const AS_RATE_LIMITED = 221; const AS_ARTICLE_WAS_DELETED = 222; const AS_NO_CREATE_PERMISSION = 223; - const AS_BLANK_ARTICLE = 224; - const AS_CONFLICT_DETECTED = 225; - const AS_SUMMARY_NEEDED = 226; - const AS_TEXTBOX_EMPTY = 228; - const AS_MAX_ARTICLE_SIZE_EXCEEDED = 229; - const AS_OK = 230; - const AS_END = 231; - const AS_SPAM_ERROR = 232; - const AS_IMAGE_REDIRECT_ANON = 233; - const AS_IMAGE_REDIRECT_LOGGED = 234; + const AS_BLANK_ARTICLE = 224; + const AS_CONFLICT_DETECTED = 225; + const AS_SUMMARY_NEEDED = 226; + const AS_TEXTBOX_EMPTY = 228; + const AS_MAX_ARTICLE_SIZE_EXCEDED = 229; + const AS_OK = 230; + const AS_END = 231; + const AS_SPAM_ERROR = 232; + const AS_IMAGE_REDIRECT_ANON = 233; + const AS_IMAGE_REDIRECT_LOGGED = 234; var $mArticle; var $mTitle; @@ -88,6 +88,7 @@ class EditPage { * @param $article */ function EditPage( $article ) { + global $wgTitle; $this->mArticle =& $article; $this->mTitle = $article->getTitle(); @@ -335,7 +336,7 @@ class EditPage { * the newly-edited page. */ function edit() { - global $wgOut, $wgUser, $wgRequest; + global $wgOut, $wgUser, $wgRequest, $wgTitle; if ( !wfRunHooks( 'AlternateEdit', array( &$this ) ) ) return; @@ -689,7 +690,7 @@ class EditPage { */ function internalAttemptSave( &$result, $bot = false ) { global $wgSpamRegex, $wgFilterCallback, $wgUser, $wgOut, $wgParser; - global $wgMaxArticleSize; + global $wgMaxArticleSize, $wgTitle; $fname = 'EditPage::attemptSave'; wfProfileIn( $fname ); @@ -702,7 +703,7 @@ class EditPage { } # Check image redirect - if ( $this->mTitle->getNamespace() == NS_IMAGE && + if ( $wgTitle->getNamespace() == NS_IMAGE && Title::newFromRedirect( $this->textbox1 ) instanceof Title && !$wgUser->isAllowed( 'upload' ) ) { if( $wgUser->isAnon() ) { @@ -741,7 +742,7 @@ class EditPage { wfProfileOut( $fname ); return self::AS_HOOK_ERROR_EXPECTED; } - if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) { + if ( $wgUser->isBlockedFrom( $wgTitle, false ) ) { # Check block state against master, thus 'false'. wfProfileOut( "$fname-checks" ); wfProfileOut( $fname ); -- 2.20.1