r30130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30129‎ | r30130 | r30131 >
Date:20:54, 24 January 2008
Author:catrope
Status:old
Tags:
Comment:
Removing some unused global $wgTitle; statements and changing $wgTitle to $this->mTitle in non-UI code. Also fixing indentation of AS_* constants.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -16,30 +16,30 @@
1717 * usually the same, but they are now allowed to be different.
1818 */
1919 class EditPage {
20 - const AS_SUCCESS_UPDATE = 200;
 20+ const AS_SUCCESS_UPDATE = 200;
2121 const AS_SUCCESS_NEW_ARTICLE = 201;
22 - const AS_HOOK_ERROR = 210;
23 - const AS_FILTERING = 211;
 22+ const AS_HOOK_ERROR = 210;
 23+ const AS_FILTERING = 211;
2424 const AS_HOOK_ERROR_EXPECTED = 212;
2525 const AS_BLOCKED_PAGE_FOR_USER = 215;
26 - const AS_CONTENT_TOO_BIG = 216;
27 - const AS_USER_CANNOT_EDIT = 217;
 26+ const AS_CONTENT_TOO_BIG = 216;
 27+ const AS_USER_CANNOT_EDIT = 217;
2828 const AS_READ_ONLY_PAGE_ANON = 218;
2929 const AS_READ_ONLY_PAGE_LOGGED = 219;
30 - const AS_READ_ONLY_PAGE = 220;
31 - const AS_RATE_LIMITED = 221;
 30+ const AS_READ_ONLY_PAGE = 220;
 31+ const AS_RATE_LIMITED = 221;
3232 const AS_ARTICLE_WAS_DELETED = 222;
3333 const AS_NO_CREATE_PERMISSION = 223;
34 - const AS_BLANK_ARTICLE = 224;
35 - const AS_CONFLICT_DETECTED = 225;
36 - const AS_SUMMARY_NEEDED = 226;
37 - const AS_TEXTBOX_EMPTY = 228;
38 - const AS_MAX_ARTICLE_SIZE_EXCEDED = 229;
39 - const AS_OK = 230;
40 - const AS_END = 231;
41 - const AS_SPAM_ERROR = 232;
42 - const AS_IMAGE_REDIRECT_ANON = 233;
43 - const AS_IMAGE_REDIRECT_LOGGED = 234;
 34+ const AS_BLANK_ARTICLE = 224;
 35+ const AS_CONFLICT_DETECTED = 225;
 36+ const AS_SUMMARY_NEEDED = 226;
 37+ const AS_TEXTBOX_EMPTY = 228;
 38+ const AS_MAX_ARTICLE_SIZE_EXCEEDED = 229;
 39+ const AS_OK = 230;
 40+ const AS_END = 231;
 41+ const AS_SPAM_ERROR = 232;
 42+ const AS_IMAGE_REDIRECT_ANON = 233;
 43+ const AS_IMAGE_REDIRECT_LOGGED = 234;
4444
4545 var $mArticle;
4646 var $mTitle;
@@ -88,7 +88,6 @@
8989 * @param $article
9090 */
9191 function EditPage( $article ) {
92 - global $wgTitle;
9392 $this->mArticle =& $article;
9493 $this->mTitle = $article->getTitle();
9594
@@ -336,7 +335,7 @@
337336 * the newly-edited page.
338337 */
339338 function edit() {
340 - global $wgOut, $wgUser, $wgRequest, $wgTitle;
 339+ global $wgOut, $wgUser, $wgRequest;
341340
342341 if ( !wfRunHooks( 'AlternateEdit', array( &$this ) ) )
343342 return;
@@ -690,7 +689,7 @@
691690 */
692691 function internalAttemptSave( &$result, $bot = false ) {
693692 global $wgSpamRegex, $wgFilterCallback, $wgUser, $wgOut, $wgParser;
694 - global $wgMaxArticleSize, $wgTitle;
 693+ global $wgMaxArticleSize;
695694
696695 $fname = 'EditPage::attemptSave';
697696 wfProfileIn( $fname );
@@ -703,7 +702,7 @@
704703 }
705704
706705 # Check image redirect
707 - if ( $wgTitle->getNamespace() == NS_IMAGE &&
 706+ if ( $this->mTitle->getNamespace() == NS_IMAGE &&
708707 Title::newFromRedirect( $this->textbox1 ) instanceof Title &&
709708 !$wgUser->isAllowed( 'upload' ) ) {
710709 if( $wgUser->isAnon() ) {
@@ -742,7 +741,7 @@
743742 wfProfileOut( $fname );
744743 return self::AS_HOOK_ERROR_EXPECTED;
745744 }
746 - if ( $wgUser->isBlockedFrom( $wgTitle, false ) ) {
 745+ if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) {
747746 # Check block state against master, thus 'false'.
748747 wfProfileOut( "$fname-checks" );
749748 wfProfileOut( $fname );

Follow-up revisions

RevisionCommit summaryAuthorDate
r30147Re-applying r30130, this time without the EXCEDED/EXCEEDED typo that caused a...catrope10:34, 25 January 2008

Status & tagging log