r40899 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40898‎ | r40899 | r40900 >
Date:04:59, 16 September 2008
Author:tstarling
Status:old
Tags:
Comment:
* Reverted code style change made by Aaron, "if (" -> "if("
* Use the convenience function selectRow() if you want a single row
* Move existence check for showDeletionLog() back to the caller, functions should do what their name says
* Revert r40674, $createRestrictions needs to be translated into some human language before it can be passed into a message. Also, note that "$a != array()" is equivalent to conversion to boolean if you know that the variable is an array.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -122,8 +122,8 @@
123123 $text = '';
124124 // For message page not locally set, use the i18n message.
125125 // For other non-existent articles, use preload text if any.
126 - if( !$this->mTitle->exists() ) {
127 - if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
 126+ if ( !$this->mTitle->exists() ) {
 127+ if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
128128 $wgMessageCache->loadAllMessages();
129129 # If this is a system message, get the default text.
130130 $text = wfMsgWeirdKey( $this->mTitle->getText() ) ;
@@ -134,14 +134,14 @@
135135 // For existing pages, get text based on "undo" or section parameters.
136136 } else {
137137 $text = $this->mArticle->getContent();
138 - if( $undo > 0 && $undoafter > 0 && $undo < $undoafter ) {
 138+ if ( $undo > 0 && $undoafter > 0 && $undo < $undoafter ) {
139139 # If they got undoafter and undo round the wrong way, switch them
140140 list( $undo, $undoafter ) = array( $undoafter, $undo );
141141 }
142 - if( $undo > 0 && $undo > $undoafter ) {
 142+ if ( $undo > 0 && $undo > $undoafter ) {
143143 # Undoing a specific edit overrides section editing; section-editing
144144 # doesn't work with undoing.
145 - if( $undoafter ) {
 145+ if ( $undoafter ) {
146146 $undorev = Revision::newFromId($undo);
147147 $oldrev = Revision::newFromId($undoafter);
148148 } else {
@@ -152,7 +152,7 @@
153153 # Sanity check, make sure it's the right page,
154154 # the revisions exist and they were not deleted.
155155 # Otherwise, $text will be left as-is.
156 - if( !is_null( $undorev ) && !is_null( $oldrev ) &&
 156+ if ( !is_null( $undorev ) && !is_null( $oldrev ) &&
157157 $undorev->getPage() == $oldrev->getPage() &&
158158 $undorev->getPage() == $this->mArticle->getID() &&
159159 !$undorev->isDeleted( Revision::DELETED_TEXT ) &&
@@ -161,19 +161,19 @@
162162 $oldrev_text = $oldrev->getText();
163163 $currev_text = $text;
164164
165 - if( $currev_text != $undorev_text ) {
 165+ if ( $currev_text != $undorev_text ) {
166166 $result = wfMerge( $undorev_text, $oldrev_text, $currev_text, $text );
167167 } else {
168168 # No use doing a merge if it's just a straight revert.
169169 $text = $oldrev_text;
170170 $result = true;
171171 }
172 - if( $result ) {
 172+ if ( $result ) {
173173 # Inform the user of our success and set an automatic edit summary
174174 $this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-success' ) );
175175 $firstrev = $oldrev->getNext();
176176 # If we just undid one rev, use an autosummary
177 - if( $firstrev->mId == $undo ) {
 177+ if ( $firstrev->mId == $undo ) {
178178 $this->summary = wfMsgForContent('undo-summary', $undo, $undorev->getUserText());
179179 }
180180 $this->formtype = 'diff';
@@ -187,8 +187,8 @@
188188 // was created, or we may simply have got bogus input.
189189 $this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-norev' ) );
190190 }
191 - } else if( $section != '' ) {
192 - if( $section == 'new' ) {
 191+ } else if ( $section != '' ) {
 192+ if ( $section == 'new' ) {
193193 $text = $this->getPreloadedText( $preload );
194194 } else {
195195 $text = $wgParser->getSection( $text, $section, $def_text );
@@ -207,13 +207,13 @@
208208 * @return string The contents of the page.
209209 */
210210 protected function getPreloadedText( $preload ) {
211 - if( $preload === '' ) {
 211+ if ( $preload === '' ) {
212212 return '';
213213 } else {
214214 $preloadTitle = Title::newFromText( $preload );
215 - if( isset( $preloadTitle ) && $preloadTitle->userCanRead() ) {
 215+ if ( isset( $preloadTitle ) && $preloadTitle->userCanRead() ) {
216216 $rev = Revision::newFromTitle($preloadTitle);
217 - if( is_object( $rev ) ) {
 217+ if ( is_object( $rev ) ) {
218218 $text = $rev->getText();
219219 // TODO FIXME: AAAAAAAAAAA, this shouldn't be implementing
220220 // its own mini-parser! -ævar
@@ -233,8 +233,8 @@
234234 function extractMetaDataFromArticle () {
235235 global $wgUseMetadataEdit , $wgMetadataWhitelist , $wgLang ;
236236 $this->mMetaData = '' ;
237 - if( !$wgUseMetadataEdit ) return ;
238 - if( $wgMetadataWhitelist == '' ) return ;
 237+ if ( !$wgUseMetadataEdit ) return ;
 238+ if ( $wgMetadataWhitelist == '' ) return ;
239239 $s = '' ;
240240 $t = $this->getContent();
241241
@@ -254,10 +254,10 @@
255255 $first = explode ( ':' , $first ) ;
256256 $ns = array_shift ( $first ) ;
257257 $ns = trim ( str_replace ( '[' , '' , $ns ) ) ;
258 - if( strlen ( $ns ) == 2 OR strtolower ( $ns ) == $catlow )
 258+ if ( strlen ( $ns ) == 2 OR strtolower ( $ns ) == $catlow )
259259 {
260260 $add = '[[' . $ns . ':' . implode ( ':' , $first ) . ']]' ;
261 - if( strtolower ( $ns ) == $catlow ) $cat[] = $add ;
 261+ if ( strtolower ( $ns ) == $catlow ) $cat[] = $add ;
262262 else $ll[] = $add ;
263263 $x = implode ( ']]' , $y ) ;
264264 $t[$key] = $x ;
@@ -265,8 +265,8 @@
266266 }
267267 }
268268 }
269 - if( count ( $cat ) ) $s .= implode ( ' ' , $cat ) . "\n" ;
270 - if( count ( $ll ) ) $s .= implode ( ' ' , $ll ) . "\n" ;
 269+ if ( count ( $cat ) ) $s .= implode ( ' ' , $cat ) . "\n" ;
 270+ if ( count ( $ll ) ) $s .= implode ( ' ' , $ll ) . "\n" ;
271271 $t = implode ( "\n" , $t ) ;
272272
273273 # Load whitelist
@@ -283,7 +283,7 @@
284284 $isentry = true ;
285285 $x = trim ( substr ( $x , 1 ) ) ;
286286 }
287 - if( $isentry )
 287+ if ( $isentry )
288288 {
289289 $sat[] = strtolower ( $x ) ;
290290 }
@@ -296,12 +296,12 @@
297297 foreach ( $t AS $key => $x )
298298 {
299299 $y = explode ( '}}' , $x , 2 ) ;
300 - if( count ( $y ) == 2 )
 300+ if ( count ( $y ) == 2 )
301301 {
302302 $z = $y[0] ;
303303 $z = explode ( '|' , $z ) ;
304304 $tn = array_shift ( $z ) ;
305 - if( in_array ( strtolower ( $tn ) , $sat ) )
 305+ if ( in_array ( strtolower ( $tn ) , $sat ) )
306306 {
307307 $tl[] = '{{' . $y[0] . '}}' ;
308308 $t[$key] = $y[1] ;
@@ -309,10 +309,10 @@
310310 }
311311 else $t[$key] = '{{' . $x ;
312312 }
313 - else if( $key != 0 ) $t[$key] = '{{' . $x ;
 313+ else if ( $key != 0 ) $t[$key] = '{{' . $x ;
314314 else $t[$key] = $x ;
315315 }
316 - if( count ( $tl ) ) $s .= implode ( ' ' , $tl ) ;
 316+ if ( count ( $tl ) ) $s .= implode ( ' ' , $tl ) ;
317317 $t = implode ( '' , $t ) ;
318318
319319 $t = str_replace ( "\n\n\n" , "\n" , $t ) ;
@@ -327,13 +327,13 @@
328328 * deletes.
329329 */
330330 protected function wasDeletedSinceLastEdit() {
331 - if( $this->deletedSinceEdit )
 331+ if ( $this->deletedSinceEdit )
332332 return true;
333 - if( $this->mTitle->isDeleted() ) {
 333+ if ( $this->mTitle->isDeleted() ) {
334334 $this->lastDelete = $this->getLastDelete();
335 - if( !is_null($this->lastDelete) ) {
 335+ if ( $this->lastDelete ) {
336336 $deletetime = $this->lastDelete->log_timestamp;
337 - if( ($deletetime - $this->starttime) > 0 ) {
 337+ if ( ($deletetime - $this->starttime) > 0 ) {
338338 $this->deletedSinceEdit = true;
339339 }
340340 }
@@ -359,7 +359,7 @@
360360 function edit() {
361361 global $wgOut, $wgUser, $wgRequest;
362362 // Allow extensions to modify/prevent this form or submission
363 - if( !wfRunHooks( 'AlternateEdit', array( &$this ) ) ) {
 363+ if ( !wfRunHooks( 'AlternateEdit', array( &$this ) ) ) {
364364 return;
365365 }
366366
@@ -372,18 +372,18 @@
373373 $this->importFormData( $wgRequest );
374374 $this->firsttime = false;
375375
376 - if( $this->live ) {
 376+ if ( $this->live ) {
377377 $this->livePreview();
378378 wfProfileOut( __METHOD__ );
379379 return;
380380 }
381381
382 - if( wfReadOnly() ) {
383 - if( $this->save ){
 382+ if ( wfReadOnly() ) {
 383+ if ( $this->save ){
384384 // Force preview
385385 $this->save = false;
386386 $this->preview = true;
387 - } elseif( $this->preview || $this->diff ) {
 387+ } elseif ( $this->preview || $this->diff ) {
388388 // A warning will be displayed instead
389389 } else {
390390 $this->readOnlyPage( $this->getContent() );
@@ -393,22 +393,22 @@
394394 }
395395
396396 $wgOut->addScriptFile( 'edit.js' );
397 -
398 - if( $permErrors = $this->getEditPermissionErrors() ) {
 397+ $permErrors = $this->getEditPermissionErrors();
 398+ if ( $permErrors ) {
399399 wfDebug( __METHOD__.": User can't edit\n" );
400400 $this->readOnlyPage( $this->getContent(), true, $permErrors, 'edit' );
401401 wfProfileOut( __METHOD__ );
402402 return;
403403 } else {
404 - if( $this->save ) {
 404+ if ( $this->save ) {
405405 $this->formtype = 'save';
406 - } else if( $this->preview ) {
 406+ } else if ( $this->preview ) {
407407 $this->formtype = 'preview';
408 - } else if( $this->diff ) {
 408+ } else if ( $this->diff ) {
409409 $this->formtype = 'diff';
410410 } else { # First time through
411411 $this->firsttime = true;
412 - if( $this->previewOnOpen() ) {
 412+ if ( $this->previewOnOpen() ) {
413413 $this->formtype = 'preview';
414414 } else {
415415 $this->extractMetaDataFromArticle () ;
@@ -425,29 +425,29 @@
426426 $this->isValidCssJsSubpage = $this->mTitle->isValidCssJsSubpage();
427427
428428 # Show applicable editing introductions
429 - if( $this->formtype == 'initial' || $this->firsttime )
 429+ if ( $this->formtype == 'initial' || $this->firsttime )
430430 $this->showIntro();
431431
432 - if( $this->mTitle->isTalkPage() ) {
 432+ if ( $this->mTitle->isTalkPage() ) {
433433 $wgOut->addWikiMsg( 'talkpagetext' );
434434 }
435435
436436 # Optional notices on a per-namespace and per-page basis
437437 $editnotice_ns = 'editnotice-'.$this->mTitle->getNamespace();
438438 $editnotice_page = $editnotice_ns.'-'.$this->mTitle->getDBkey();
439 - if( !wfEmptyMsg( $editnotice_ns, wfMsgForContent( $editnotice_ns ) ) ) {
 439+ if ( !wfEmptyMsg( $editnotice_ns, wfMsgForContent( $editnotice_ns ) ) ) {
440440 $wgOut->addWikiText( wfMsgForContent( $editnotice_ns ) );
441441 }
442 - if( MWNamespace::hasSubpages( $this->mTitle->getNamespace() ) ) {
 442+ if ( MWNamespace::hasSubpages( $this->mTitle->getNamespace() ) ) {
443443 $parts = explode( '/', $this->mTitle->getDBkey() );
444444 $editnotice_base = $editnotice_ns;
445445 while ( count( $parts ) > 0 ) {
446446 $editnotice_base .= '-'.array_shift( $parts );
447 - if( !wfEmptyMsg( $editnotice_base, wfMsgForContent( $editnotice_base ) ) ) {
 447+ if ( !wfEmptyMsg( $editnotice_base, wfMsgForContent( $editnotice_base ) ) ) {
448448 $wgOut->addWikiText( wfMsgForContent( $editnotice_base ) );
449449 }
450450 }
451 - } else if( !wfEmptyMsg( $editnotice_page, wfMsgForContent( $editnotice_page ) ) ) {
 451+ } else if ( !wfEmptyMsg( $editnotice_page, wfMsgForContent( $editnotice_page ) ) ) {
452452 $wgOut->addWikiText( wfMsgForContent( $editnotice_page ) );
453453 }
454454
@@ -456,8 +456,8 @@
457457 # that edit() already checked just in case someone tries to sneak
458458 # in the back door with a hand-edited submission URL.
459459
460 - if( 'save' == $this->formtype ) {
461 - if( !$this->attemptSave() ) {
 460+ if ( 'save' == $this->formtype ) {
 461+ if ( !$this->attemptSave() ) {
462462 wfProfileOut( __METHOD__."-business-end" );
463463 wfProfileOut( __METHOD__ );
464464 return;
@@ -466,14 +466,14 @@
467467
468468 # First time through: get contents, set time for conflict
469469 # checking, etc.
470 - if( 'initial' == $this->formtype || $this->firsttime ) {
471 - if( $this->initialiseForm() === false) {
 470+ if ( 'initial' == $this->formtype || $this->firsttime ) {
 471+ if ( $this->initialiseForm() === false) {
472472 $this->noSuchSectionPage();
473473 wfProfileOut( __METHOD__."-business-end" );
474474 wfProfileOut( __METHOD__ );
475475 return;
476476 }
477 - if( !$this->mTitle->getArticleId() )
 477+ if ( !$this->mTitle->getArticleId() )
478478 wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
479479 }
480480
@@ -486,14 +486,14 @@
487487 global $wgUser;
488488 $permErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser );
489489 # Can this title be created?
490 - if( !$this->mTitle->exists() ) {
 490+ if ( !$this->mTitle->exists() ) {
491491 $permErrors = array_merge( $permErrors,
492492 wfArrayDiff2( $this->mTitle->getUserPermissionsErrors( 'create', $wgUser ), $permErrors ) );
493493 }
494494 # Ignore some permissions errors when a user is just previewing/viewing diffs
495495 $remove = array();
496496 foreach( $permErrors as $error ) {
497 - if( ($this->preview || $this->diff) &&
 497+ if ( ($this->preview || $this->diff) &&
498498 ($error[0] == 'blockedtext' || $error[0] == 'autoblockedtext') )
499499 {
500500 $remove[] = $error;
@@ -510,7 +510,7 @@
511511 */
512512 function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) {
513513 global $wgRequest, $wgOut;
514 - if( $wgRequest->getBool( 'redlink' ) ) {
 514+ if ( $wgRequest->getBool( 'redlink' ) ) {
515515 // The edit page was reached via a red link.
516516 // Redirect to the article page and let them click the edit tab if
517517 // they really want a permission error.
@@ -527,19 +527,19 @@
528528 */
529529 protected function previewOnOpen() {
530530 global $wgRequest, $wgUser;
531 - if( $wgRequest->getVal( 'preview' ) == 'yes' ) {
 531+ if ( $wgRequest->getVal( 'preview' ) == 'yes' ) {
532532 // Explicit override from request
533533 return true;
534 - } elseif( $wgRequest->getVal( 'preview' ) == 'no' ) {
 534+ } elseif ( $wgRequest->getVal( 'preview' ) == 'no' ) {
535535 // Explicit override from request
536536 return false;
537 - } elseif( $this->section == 'new' ) {
 537+ } elseif ( $this->section == 'new' ) {
538538 // Nothing *to* preview for new sections
539539 return false;
540 - } elseif( ( $wgRequest->getVal( 'preload' ) !== '' || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
 540+ } elseif ( ( $wgRequest->getVal( 'preload' ) !== '' || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
541541 // Standard preference behaviour
542542 return true;
543 - } elseif( !$this->mTitle->exists() && $this->mTitle->getNamespace() == NS_CATEGORY ) {
 543+ } elseif ( !$this->mTitle->exists() && $this->mTitle->getNamespace() == NS_CATEGORY ) {
544544 // Categories are special
545545 return true;
546546 } else {
@@ -559,7 +559,7 @@
560560 # Section edit can come from either the form or a link
561561 $this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) );
562562
563 - if( $request->wasPosted() ) {
 563+ if ( $request->wasPosted() ) {
564564 # These fields need to be checked for encoding.
565565 # Also remove trailing whitespace, but don't remove _initial_
566566 # whitespace from the text boxes. This may be significant formatting.
@@ -577,7 +577,7 @@
578578
579579 $this->scrolltop = $request->getIntOrNull( 'wpScrolltop' );
580580
581 - if( is_null( $this->edittime ) ) {
 581+ if ( is_null( $this->edittime ) ) {
582582 # If the form is incomplete, force to preview.
583583 wfDebug( "$fname: Form data appears to be incomplete\n" );
584584 wfDebug( "POST DATA: " . var_export( $_POST, true ) . "\n" );
@@ -591,13 +591,13 @@
592592 // if we forced preview due to session failure.
593593 $this->mTriedSave = !$this->preview;
594594
595 - if( $this->tokenOk( $request ) ) {
 595+ if ( $this->tokenOk( $request ) ) {
596596 # Some browsers will not report any submit button
597597 # if the user hits enter in the comment box.
598598 # The unmarked state will be assumed to be a save,
599599 # if the form seems otherwise complete.
600600 wfDebug( "$fname: Passed token check.\n" );
601 - } else if( $this->diff ) {
 601+ } else if ( $this->diff ) {
602602 # Failed token check, but only requested "Show Changes".
603603 wfDebug( "$fname: Failed token check; Show Changes requested.\n" );
604604 } else {
@@ -608,11 +608,11 @@
609609 }
610610 }
611611 $this->save = !$this->preview && !$this->diff;
612 - if( !preg_match( '/^\d{14}$/', $this->edittime )) {
 612+ if ( !preg_match( '/^\d{14}$/', $this->edittime )) {
613613 $this->edittime = null;
614614 }
615615
616 - if( !preg_match( '/^\d{14}$/', $this->starttime )) {
 616+ if ( !preg_match( '/^\d{14}$/', $this->starttime )) {
617617 $this->starttime = null;
618618 }
619619
@@ -622,7 +622,7 @@
623623 $this->watchthis = $request->getCheck( 'wpWatchthis' );
624624
625625 # Don't force edit summaries when a user is editing their own user or talk page
626 - if( ( $this->mTitle->mNamespace == NS_USER || $this->mTitle->mNamespace == NS_USER_TALK ) && $this->mTitle->getText() == $wgUser->getName() ) {
 626+ if ( ( $this->mTitle->mNamespace == NS_USER || $this->mTitle->mNamespace == NS_USER_TALK ) && $this->mTitle->getText() == $wgUser->getName() ) {
627627 $this->allowBlankSummary = true;
628628 } else {
629629 $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' );
@@ -646,7 +646,7 @@
647647 $this->watchthis = false;
648648 $this->recreate = false;
649649
650 - if( $this->section == 'new' && $request->getVal( 'preloadtitle' ) ) {
 650+ if ( $this->section == 'new' && $request->getVal( 'preloadtitle' ) ) {
651651 $this->summary = $request->getVal( 'preloadtitle' );
652652 }
653653 }
@@ -679,30 +679,32 @@
680680 */
681681 protected function showIntro() {
682682 global $wgOut, $wgUser;
683 - if( $this->suppressIntro ) {
 683+ if ( $this->suppressIntro ) {
684684 return;
685685 }
686686 # Show a warning message when someone creates/edits a user (talk) page but the user does not exists
687 - if( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
 687+ if ( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
688688 $parts = explode( '/', $this->mTitle->getText(), 2 );
689689 $username = $parts[0];
690690 $id = User::idFromName( $username );
691691 $ip = User::isIP( $username );
692 - if( $id == 0 && !$ip ) {
 692+ if ( $id == 0 && !$ip ) {
693693 $wgOut->wrapWikiMsg( '<div class="mw-userpage-userdoesnotexist error">$1</div>',
694694 array( 'userpage-userdoesnotexist', $username ) );
695695 }
696696 }
697697 # Try to add a custom edit intro, or use the standard one if this is not possible.
698 - if( !$this->showCustomIntro() && !$this->mTitle->exists() ) {
699 - if( $wgUser->isLoggedIn() ) {
 698+ if ( !$this->showCustomIntro() && !$this->mTitle->exists() ) {
 699+ if ( $wgUser->isLoggedIn() ) {
700700 $wgOut->wrapWikiMsg( '<div class="mw-newarticletext">$1</div>', 'newarticletext' );
701701 } else {
702702 $wgOut->wrapWikiMsg( '<div class="mw-newarticletextanon">$1</div>', 'newarticletextanon' );
703703 }
704704 }
705705 # Give a notice if the user is editing a deleted page...
706 - $this->showDeletionLog( $wgOut );
 706+ if ( $this->mTitle->exists() ) {
 707+ $this->showDeletionLog( $wgOut );
 708+ }
707709 }
708710
709711 /**
@@ -711,9 +713,9 @@
712714 * @return bool
713715 */
714716 protected function showCustomIntro() {
715 - if( $this->editintro ) {
 717+ if ( $this->editintro ) {
716718 $title = Title::newFromText( $this->editintro );
717 - if( $title instanceof Title && $title->exists() && $title->userCanRead() ) {
 719+ if ( $title instanceof Title && $title->exists() && $title->userCanRead() ) {
718720 global $wgOut;
719721 $revision = Revision::newFromTitle( $title );
720722 $wgOut->addWikiTextTitleTidy( $revision->getText(), $this->mTitle );
@@ -738,17 +740,17 @@
739741 wfProfileIn( $fname );
740742 wfProfileIn( "$fname-checks" );
741743
742 - if( !wfRunHooks( 'EditPage::attemptSave', array( &$this ) ) )
 744+ if ( !wfRunHooks( 'EditPage::attemptSave', array( &$this ) ) )
743745 {
744746 wfDebug( "Hook 'EditPage::attemptSave' aborted article saving" );
745747 return self::AS_HOOK_ERROR;
746748 }
747749
748750 # Check image redirect
749 - if( $this->mTitle->getNamespace() == NS_IMAGE &&
 751+ if ( $this->mTitle->getNamespace() == NS_IMAGE &&
750752 Title::newFromRedirect( $this->textbox1 ) instanceof Title &&
751753 !$wgUser->isAllowed( 'upload' ) ) {
752 - if( $wgUser->isAnon() ) {
 754+ if ( $wgUser->isAnon() ) {
753755 return self::AS_IMAGE_REDIRECT_ANON;
754756 } else {
755757 return self::AS_IMAGE_REDIRECT_LOGGED;
@@ -756,15 +758,15 @@
757759 }
758760
759761 # Reintegrate metadata
760 - if( $this->mMetaData != '' ) $this->textbox1 .= "\n" . $this->mMetaData ;
 762+ if ( $this->mMetaData != '' ) $this->textbox1 .= "\n" . $this->mMetaData ;
761763 $this->mMetaData = '' ;
762764
763765 # Check for spam
764766 $match = self::matchSpamRegex( $this->summary );
765 - if( $match === false ) {
 767+ if ( $match === false ) {
766768 $match = self::matchSpamRegex( $this->textbox1 );
767769 }
768 - if( $match !== false ) {
 770+ if ( $match !== false ) {
769771 $result['spam'] = $match;
770772 $ip = wfGetIP();
771773 $pdbk = $this->mTitle->getPrefixedDBkey();
@@ -774,31 +776,31 @@
775777 wfProfileOut( $fname );
776778 return self::AS_SPAM_ERROR;
777779 }
778 - if( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section, $this->hookError, $this->summary ) ) {
 780+ if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section, $this->hookError, $this->summary ) ) {
779781 # Error messages or other handling should be performed by the filter function
780782 wfProfileOut( "$fname-checks" );
781783 wfProfileOut( $fname );
782784 return self::AS_FILTERING;
783785 }
784 - if( !wfRunHooks( 'EditFilter', array( $this, $this->textbox1, $this->section, &$this->hookError, $this->summary ) ) ) {
 786+ if ( !wfRunHooks( 'EditFilter', array( $this, $this->textbox1, $this->section, &$this->hookError, $this->summary ) ) ) {
785787 # Error messages etc. could be handled within the hook...
786788 wfProfileOut( "$fname-checks" );
787789 wfProfileOut( $fname );
788790 return self::AS_HOOK_ERROR;
789 - } elseif( $this->hookError != '' ) {
 791+ } elseif ( $this->hookError != '' ) {
790792 # ...or the hook could be expecting us to produce an error
791793 wfProfileOut( "$fname-checks" );
792794 wfProfileOut( $fname );
793795 return self::AS_HOOK_ERROR_EXPECTED;
794796 }
795 - if( $wgUser->isBlockedFrom( $this->mTitle, false ) ) {
 797+ if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) {
796798 # Check block state against master, thus 'false'.
797799 wfProfileOut( "$fname-checks" );
798800 wfProfileOut( $fname );
799801 return self::AS_BLOCKED_PAGE_FOR_USER;
800802 }
801803 $this->kblength = (int)(strlen( $this->textbox1 ) / 1024);
802 - if( $this->kblength > $wgMaxArticleSize ) {
 804+ if ( $this->kblength > $wgMaxArticleSize ) {
803805 // Error will be displayed by showEditForm()
804806 $this->tooBig = true;
805807 wfProfileOut( "$fname-checks" );
@@ -806,8 +808,8 @@
807809 return self::AS_CONTENT_TOO_BIG;
808810 }
809811
810 - if( !$wgUser->isAllowed('edit') ) {
811 - if( $wgUser->isAnon() ) {
 812+ if ( !$wgUser->isAllowed('edit') ) {
 813+ if ( $wgUser->isAnon() ) {
812814 wfProfileOut( "$fname-checks" );
813815 wfProfileOut( $fname );
814816 return self::AS_READ_ONLY_PAGE_ANON;
@@ -819,12 +821,12 @@
820822 }
821823 }
822824
823 - if( wfReadOnly() ) {
 825+ if ( wfReadOnly() ) {
824826 wfProfileOut( "$fname-checks" );
825827 wfProfileOut( $fname );
826828 return self::AS_READ_ONLY_PAGE;
827829 }
828 - if( $wgUser->pingLimiter() ) {
 830+ if ( $wgUser->pingLimiter() ) {
829831 wfProfileOut( "$fname-checks" );
830832 wfProfileOut( $fname );
831833 return self::AS_RATE_LIMITED;
@@ -832,7 +834,7 @@
833835
834836 # If the article has been deleted while editing, don't save it without
835837 # confirmation
836 - if( $this->wasDeletedSinceLastEdit() && !$this->recreate ) {
 838+ if ( $this->wasDeletedSinceLastEdit() && !$this->recreate ) {
837839 wfProfileOut( "$fname-checks" );
838840 wfProfileOut( $fname );
839841 return self::AS_ARTICLE_WAS_DELETED;
@@ -842,23 +844,23 @@
843845
844846 # If article is new, insert it.
845847 $aid = $this->mTitle->getArticleID( GAID_FOR_UPDATE );
846 - if( 0 == $aid ) {
 848+ if ( 0 == $aid ) {
847849
848850 // Late check for create permission, just in case *PARANOIA*
849 - if( !$this->mTitle->userCan( 'create' ) ) {
 851+ if ( !$this->mTitle->userCan( 'create' ) ) {
850852 wfDebug( "$fname: no create permission\n" );
851853 wfProfileOut( $fname );
852854 return self::AS_NO_CREATE_PERMISSION;
853855 }
854856
855857 # Don't save a new article if it's blank.
856 - if( '' == $this->textbox1 ) {
 858+ if ( '' == $this->textbox1 ) {
857859 wfProfileOut( $fname );
858860 return self::AS_BLANK_ARTICLE;
859861 }
860862
861863 // Run post-section-merge edit filter
862 - if( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError, $this->summary ) ) ) {
 864+ if ( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError, $this->summary ) ) ) {
863865 # Error messages etc. could be handled within the hook...
864866 wfProfileOut( $fname );
865867 return self::AS_HOOK_ERROR;
@@ -880,10 +882,10 @@
881883
882884 wfDebug("timestamp: {$this->mArticle->getTimestamp()}, edittime: {$this->edittime}\n");
883885
884 - if( $this->mArticle->getTimestamp() != $this->edittime ) {
 886+ if ( $this->mArticle->getTimestamp() != $this->edittime ) {
885887 $this->isConflict = true;
886 - if( $this->section == 'new' ) {
887 - if( $this->mArticle->getUserText() == $wgUser->getName() &&
 888+ if ( $this->section == 'new' ) {
 889+ if ( $this->mArticle->getUserText() == $wgUser->getName() &&
888890 $this->mArticle->getComment() == $this->summary ) {
889891 // Probably a duplicate submission of a new comment.
890892 // This can happen when squid resends a request after
@@ -898,7 +900,7 @@
899901 }
900902 $userid = $wgUser->getId();
901903
902 - if( $this->isConflict ) {
 904+ if ( $this->isConflict ) {
903905 wfDebug( "EditPage::editForm conflict! getting section '$this->section' for time '$this->edittime' (article time '" .
904906 $this->mArticle->getTimestamp() . "')\n" );
905907 $text = $this->mArticle->replaceSection( $this->section, $this->textbox1, $this->summary, $this->edittime);
@@ -907,21 +909,21 @@
908910 wfDebug( "EditPage::editForm getting section '$this->section'\n" );
909911 $text = $this->mArticle->replaceSection( $this->section, $this->textbox1, $this->summary);
910912 }
911 - if( is_null( $text ) ) {
 913+ if ( is_null( $text ) ) {
912914 wfDebug( "EditPage::editForm activating conflict; section replace failed.\n" );
913915 $this->isConflict = true;
914916 $text = $this->textbox1;
915917 }
916918
917919 # Suppress edit conflict with self, except for section edits where merging is required.
918 - if( ( $this->section == '' ) && ( 0 != $userid ) && ( $this->mArticle->getUser() == $userid ) ) {
 920+ if ( ( $this->section == '' ) && ( 0 != $userid ) && ( $this->mArticle->getUser() == $userid ) ) {
919921 wfDebug( "EditPage::editForm Suppressing edit conflict, same user.\n" );
920922 $this->isConflict = false;
921923 } else {
922924 # switch from section editing to normal editing in edit conflict
923 - if( $this->isConflict ) {
 925+ if ( $this->isConflict ) {
924926 # Attempt merge
925 - if( $this->mergeChangesInto( $text ) ) {
 927+ if ( $this->mergeChangesInto( $text ) ) {
926928 // Successful merge! Maybe we should tell the user the good news?
927929 $this->isConflict = false;
928930 wfDebug( "EditPage::editForm Suppressing edit conflict, successful merge.\n" );
@@ -933,7 +935,7 @@
934936 }
935937 }
936938
937 - if( $this->isConflict ) {
 939+ if ( $this->isConflict ) {
938940 wfProfileOut( $fname );
939941 return self::AS_CONFLICT_DETECTED;
940942 }
@@ -941,19 +943,19 @@
942944 $oldtext = $this->mArticle->getContent();
943945
944946 // Run post-section-merge edit filter
945 - if( !wfRunHooks( 'EditFilterMerged', array( $this, $text, &$this->hookError, $this->summary ) ) ) {
 947+ if ( !wfRunHooks( 'EditFilterMerged', array( $this, $text, &$this->hookError, $this->summary ) ) ) {
946948 # Error messages etc. could be handled within the hook...
947949 wfProfileOut( $fname );
948950 return self::AS_HOOK_ERROR;
949951 }
950952
951953 # Handle the user preference to force summaries here, but not for null edits
952 - if( $this->section != 'new' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary') &&
 954+ if ( $this->section != 'new' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary') &&
953955 0 != strcmp($oldtext, $text) &&
954956 !is_object( Title::newFromRedirect( $text ) ) # check if it's not a redirect
955957 ) {
956958
957 - if( md5( $this->summary ) == $this->autoSumm ) {
 959+ if ( md5( $this->summary ) == $this->autoSumm ) {
958960 $this->missingSummary = true;
959961 wfProfileOut( $fname );
960962 return self::AS_SUMMARY_NEEDED;
@@ -961,8 +963,8 @@
962964 }
963965
964966 # And a similar thing for new sections
965 - if( $this->section == 'new' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary' ) ) {
966 - if(trim($this->summary) == '') {
 967+ if ( $this->section == 'new' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary' ) ) {
 968+ if (trim($this->summary) == '') {
967969 $this->missingSummary = true;
968970 wfProfileOut( $fname );
969971 return self::AS_SUMMARY_NEEDED;
@@ -972,26 +974,26 @@
973975 # All's well
974976 wfProfileIn( "$fname-sectionanchor" );
975977 $sectionanchor = '';
976 - if( $this->section == 'new' ) {
977 - if( $this->textbox1 == '' ) {
 978+ if ( $this->section == 'new' ) {
 979+ if ( $this->textbox1 == '' ) {
978980 $this->missingComment = true;
979981 return self::AS_TEXTBOX_EMPTY;
980982 }
981 - if( $this->summary != '' ) {
 983+ if ( $this->summary != '' ) {
982984 $sectionanchor = $wgParser->guessSectionNameFromWikiText( $this->summary );
983985 # This is a new section, so create a link to the new section
984986 # in the revision summary.
985987 $cleanSummary = $wgParser->stripSectionName( $this->summary );
986988 $this->summary = wfMsgForContent( 'newsectionsummary', $cleanSummary );
987989 }
988 - } elseif( $this->section != '' ) {
 990+ } elseif ( $this->section != '' ) {
989991 # Try to get a section anchor from the section source, redirect to edited section if header found
990992 # XXX: might be better to integrate this into Article::replaceSection
991993 # for duplicate heading checking and maybe parsing
992994 $hasmatch = preg_match( "/^ *([=]{1,6})(.*?)(\\1) *\\n/i", $this->textbox1, $matches );
993995 # we can't deal with anchors, includes, html etc in the header for now,
994996 # headline would need to be parsed to improve this
995 - if( $hasmatch and strlen($matches[2]) > 0 ) {
 997+ if ( $hasmatch and strlen($matches[2]) > 0 ) {
996998 $sectionanchor = $wgParser->guessSectionNameFromWikiText( $matches[2] );
997999 }
9981000 }
@@ -1006,14 +1008,14 @@
10071009
10081010 // Check for length errors again now that the section is merged in
10091011 $this->kblength = (int)(strlen( $text ) / 1024);
1010 - if( $this->kblength > $wgMaxArticleSize ) {
 1012+ if ( $this->kblength > $wgMaxArticleSize ) {
10111013 $this->tooBig = true;
10121014 wfProfileOut( $fname );
10131015 return self::AS_MAX_ARTICLE_SIZE_EXCEEDED;
10141016 }
10151017
10161018 # update the article here
1017 - if( $this->mArticle->updateArticle( $text, $this->summary, $this->minoredit,
 1019+ if ( $this->mArticle->updateArticle( $text, $this->summary, $this->minoredit,
10181020 $this->watchthis, $bot, $sectionanchor ) ) {
10191021 wfProfileOut( $fname );
10201022 return self::AS_SUCCESS_UPDATE;
@@ -1030,12 +1032,12 @@
10311033 */
10321034 public static function matchSpamRegex( $text ) {
10331035 global $wgSpamRegex;
1034 - if( $wgSpamRegex ) {
 1036+ if ( $wgSpamRegex ) {
10351037 // For back compatibility, $wgSpamRegex may be a single string or an array of regexes.
10361038 $regexes = (array)$wgSpamRegex;
10371039 foreach( $regexes as $regex ) {
10381040 $matches = array();
1039 - if( preg_match( $regex, $text, $matches ) ) {
 1041+ if ( preg_match( $regex, $text, $matches ) ) {
10401042 return $matches[0];
10411043 }
10421044 }
@@ -1050,9 +1052,9 @@
10511053 function initialiseForm() {
10521054 $this->edittime = $this->mArticle->getTimestamp();
10531055 $this->textbox1 = $this->getContent(false);
1054 - if( $this->textbox1 === false) return false;
 1056+ if ( $this->textbox1 === false) return false;
10551057
1056 - if( !$this->mArticle->exists() && $this->mTitle->getNamespace() == NS_MEDIAWIKI )
 1058+ if ( !$this->mArticle->exists() && $this->mTitle->getNamespace() == NS_MEDIAWIKI )
10571059 $this->textbox1 = wfMsgWeirdKey( $this->mTitle->getText() );
10581060 wfProxyCheck();
10591061 return true;
@@ -1061,17 +1063,17 @@
10621064 function setHeaders() {
10631065 global $wgOut, $wgTitle;
10641066 $wgOut->setRobotPolicy( 'noindex,nofollow' );
1065 - if( $this->formtype == 'preview' ) {
 1067+ if ( $this->formtype == 'preview' ) {
10661068 $wgOut->setPageTitleActionText( wfMsg( 'preview' ) );
10671069 }
1068 - if( $this->isConflict ) {
 1070+ if ( $this->isConflict ) {
10691071 $wgOut->setPageTitle( wfMsg( 'editconflict', $wgTitle->getPrefixedText() ) );
1070 - } elseif( $this->section != '' ) {
 1072+ } elseif ( $this->section != '' ) {
10711073 $msg = $this->section == 'new' ? 'editingcomment' : 'editingsection';
10721074 $wgOut->setPageTitle( wfMsg( $msg, $wgTitle->getPrefixedText() ) );
10731075 } else {
10741076 # Use the title defined by DISPLAYTITLE magic word when present
1075 - if( isset($this->mParserOutput)
 1077+ if ( isset($this->mParserOutput)
10761078 && ( $dt = $this->mParserOutput->getDisplayTitle() ) !== false ) {
10771079 $title = $dt;
10781080 } else {
@@ -1094,7 +1096,7 @@
10951097 # Some hook probably called this function without checking
10961098 # for is_null($wgTitle) first. Bail out right here so we don't
10971099 # do lots of work just to discard it right after.
1098 - if(is_null($wgTitle))
 1100+ if (is_null($wgTitle))
10991101 return;
11001102
11011103 $fname = 'EditPage::showEditForm';
@@ -1109,7 +1111,7 @@
11101112 #we parse this near the beginning so that setHeaders can do the title
11111113 #setting work instead of leaving it in getPreviewText
11121114 $previewOutput = '';
1113 - if( $this->formtype == 'preview' ) {
 1115+ if ( $this->formtype == 'preview' ) {
11141116 $previewOutput = $this->getPreviewText();
11151117 }
11161118
@@ -1118,20 +1120,20 @@
11191121 # Enabled article-related sidebar, toplinks, etc.
11201122 $wgOut->setArticleRelated( true );
11211123
1122 - if( $this->isConflict ) {
 1124+ if ( $this->isConflict ) {
11231125 $wgOut->addWikiMsg( 'explainconflict' );
11241126
11251127 $this->textbox2 = $this->textbox1;
11261128 $this->textbox1 = $this->getContent();
11271129 $this->edittime = $this->mArticle->getTimestamp();
11281130 } else {
1129 - if( $this->section != '' && $this->section != 'new' ) {
 1131+ if ( $this->section != '' && $this->section != 'new' ) {
11301132 $matches = array();
1131 - if( !$this->summary && !$this->preview && !$this->diff ) {
 1133+ if ( !$this->summary && !$this->preview && !$this->diff ) {
11321134 preg_match( "/^(=+)(.+)\\1/mi",
11331135 $this->textbox1,
11341136 $matches );
1135 - if( !empty( $matches[2] ) ) {
 1137+ if ( !empty( $matches[2] ) ) {
11361138 global $wgParser;
11371139 $this->summary = "/* " .
11381140 $wgParser->stripSectionName(trim($matches[2])) .
@@ -1140,49 +1142,49 @@
11411143 }
11421144 }
11431145
1144 - if( $this->missingComment ) {
 1146+ if ( $this->missingComment ) {
11451147 $wgOut->wrapWikiMsg( '<div id="mw-missingcommenttext">$1</div>', 'missingcommenttext' );
11461148 }
11471149
1148 - if( $this->missingSummary && $this->section != 'new' ) {
 1150+ if ( $this->missingSummary && $this->section != 'new' ) {
11491151 $wgOut->wrapWikiMsg( '<div id="mw-missingsummary">$1</div>', 'missingsummary' );
11501152 }
11511153
1152 - if( $this->missingSummary && $this->section == 'new' ) {
 1154+ if ( $this->missingSummary && $this->section == 'new' ) {
11531155 $wgOut->wrapWikiMsg( '<div id="mw-missingcommentheader">$1</div>', 'missingcommentheader' );
11541156 }
11551157
1156 - if( $this->hookError !== '' ) {
 1158+ if ( $this->hookError !== '' ) {
11571159 $wgOut->addWikiText( $this->hookError );
11581160 }
11591161
1160 - if( !$this->checkUnicodeCompliantBrowser() ) {
 1162+ if ( !$this->checkUnicodeCompliantBrowser() ) {
11611163 $wgOut->addWikiMsg( 'nonunicodebrowser' );
11621164 }
1163 - if( isset( $this->mArticle ) && isset( $this->mArticle->mRevision ) ) {
 1165+ if ( isset( $this->mArticle ) && isset( $this->mArticle->mRevision ) ) {
11641166 // Let sysop know that this will make private content public if saved
11651167
1166 - if( !$this->mArticle->mRevision->userCan( Revision::DELETED_TEXT ) ) {
 1168+ if ( !$this->mArticle->mRevision->userCan( Revision::DELETED_TEXT ) ) {
11671169 $wgOut->addWikiMsg( 'rev-deleted-text-permission' );
1168 - } else if( $this->mArticle->mRevision->isDeleted( Revision::DELETED_TEXT ) ) {
 1170+ } else if ( $this->mArticle->mRevision->isDeleted( Revision::DELETED_TEXT ) ) {
11691171 $wgOut->addWikiMsg( 'rev-deleted-text-view' );
11701172 }
11711173
1172 - if( !$this->mArticle->mRevision->isCurrent() ) {
 1174+ if ( !$this->mArticle->mRevision->isCurrent() ) {
11731175 $this->mArticle->setOldSubtitle( $this->mArticle->mRevision->getId() );
11741176 $wgOut->addWikiMsg( 'editingold' );
11751177 }
11761178 }
11771179 }
11781180
1179 - if( wfReadOnly() ) {
 1181+ if ( wfReadOnly() ) {
11801182 $wgOut->wrapWikiMsg( "<div id=\"mw-read-only-warning\">\n$1\n</div>", array( 'readonlywarning', wfReadOnlyReason() ) );
1181 - } elseif( $wgUser->isAnon() && $this->formtype != 'preview' ) {
 1183+ } elseif ( $wgUser->isAnon() && $this->formtype != 'preview' ) {
11821184 $wgOut->wrapWikiMsg( '<div id="mw-anon-edit-warning">$1</div>', 'anoneditwarning' );
11831185 } else {
1184 - if( $this->isCssJsSubpage && $this->formtype != 'preview' ) {
 1186+ if ( $this->isCssJsSubpage && $this->formtype != 'preview' ) {
11851187 # Check the skin exists
1186 - if( $this->isValidCssJsSubpage ) {
 1188+ if ( $this->isValidCssJsSubpage ) {
11871189 $wgOut->addWikiMsg( 'usercssjsyoucanpreview' );
11881190 } else {
11891191 $wgOut->addWikiMsg( 'userinvalidcssjstitle', $wgTitle->getSkinFromCssJsSubpage() );
@@ -1191,12 +1193,12 @@
11921194 }
11931195
11941196 $classes = array(); // Textarea CSS
1195 - if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
 1197+ if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
11961198 # Show a warning if editing an interface message
11971199 $wgOut->addWikiMsg( 'editinginterface' );
1198 - } elseif( $this->mTitle->isProtected( 'edit' ) ) {
 1200+ } elseif ( $this->mTitle->isProtected( 'edit' ) ) {
11991201 # Is the title semi-protected?
1200 - if( $this->mTitle->isSemiProtected() ) {
 1202+ if ( $this->mTitle->isSemiProtected() ) {
12011203 $noticeMsg = 'semiprotectedpagewarning';
12021204 $classes[] = 'mw-textarea-sprotected';
12031205 } else {
@@ -1209,11 +1211,11 @@
12101212 LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '', 1 );
12111213 $wgOut->addHTML( "</div>\n" );
12121214 }
1213 - if( $this->mTitle->isCascadeProtected() ) {
 1215+ if ( $this->mTitle->isCascadeProtected() ) {
12141216 # Is this page under cascading protection from some source pages?
12151217 list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
12161218 $notice = "$1\n";
1217 - if( count($cascadeSources) > 0 ) {
 1219+ if ( count($cascadeSources) > 0 ) {
12181220 # Explain, and list the titles responsible
12191221 foreach( $cascadeSources as $page ) {
12201222 $notice .= '* [[:' . $page->getPrefixedText() . "]]\n";
@@ -1221,25 +1223,25 @@
12221224 }
12231225 $wgOut->wrapWikiMsg( $notice, array( 'cascadeprotectedwarning', count($cascadeSources) ) );
12241226 }
1225 - if( !$this->mTitle->exists() && ( $createRestrictions = $this->mTitle->getRestrictions( 'create' ) ) != array() ){
1226 - $wgOut->addWikiMsgArray( 'titleprotectedwarning', $createRestrictions );
 1227+ if ( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) ) {
 1228+ $wgOut->addWikiMsg( 'titleprotectedwarning' );
12271229 }
12281230
1229 - if( $this->kblength === false ) {
 1231+ if ( $this->kblength === false ) {
12301232 $this->kblength = (int)(strlen( $this->textbox1 ) / 1024);
12311233 }
1232 - if( $this->tooBig || $this->kblength > $wgMaxArticleSize ) {
 1234+ if ( $this->tooBig || $this->kblength > $wgMaxArticleSize ) {
12331235 $wgOut->addHTML( "<div id='mw-edit-longpageerror'>\n" );
12341236 $wgOut->addWikiMsg( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgLang->formatNum( $wgMaxArticleSize ) );
12351237 $wgOut->addHTML( "</div>\n" );
1236 - } elseif( $this->kblength > 29 ) {
 1238+ } elseif ( $this->kblength > 29 ) {
12371239 $wgOut->addHTML( "<div id='mw-edit-longpagewarning'>\n" );
12381240 $wgOut->addWikiMsg( 'longpagewarning', $wgLang->formatNum( $this->kblength ) );
12391241 $wgOut->addHTML( "</div>\n" );
12401242 }
12411243
12421244 $q = 'action='.$this->action;
1243 - #if( "no" == $redirect ) { $q .= "&redirect=no"; }
 1245+ #if ( "no" == $redirect ) { $q .= "&redirect=no"; }
12441246 $action = $wgTitle->escapeLocalURL( $q );
12451247
12461248 $colonSep = wfMsg( 'colon-separator' );
@@ -1254,7 +1256,7 @@
12551257 htmlspecialchars( wfMsg( 'newwindow' ) );
12561258
12571259 global $wgRightsText;
1258 - if( $wgRightsText ) {
 1260+ if ( $wgRightsText ) {
12591261 $copywarnMsg = array( 'copyrightwarning',
12601262 '[[' . wfMsgForContent( 'copyrightpage' ) . ']]',
12611263 $wgRightsText );
@@ -1263,7 +1265,7 @@
12641266 '[[' . wfMsgForContent( 'copyrightpage' ) . ']]' );
12651267 }
12661268
1267 - if( $wgUser->getOption('showtoolbar') and !$this->isCssJsSubpage ) {
 1269+ if ( $wgUser->getOption('showtoolbar') and !$this->isCssJsSubpage ) {
12681270 # prepare toolbar for edit buttons
12691271 $toolbar = EditPage::getEditToolbar();
12701272 } else {
@@ -1271,25 +1273,25 @@
12721274 }
12731275
12741276 // activate checkboxes if user wants them to be always active
1275 - if( !$this->preview && !$this->diff ) {
 1277+ if ( !$this->preview && !$this->diff ) {
12761278 # Sort out the "watch" checkbox
1277 - if( $wgUser->getOption( 'watchdefault' ) ) {
 1279+ if ( $wgUser->getOption( 'watchdefault' ) ) {
12781280 # Watch all edits
12791281 $this->watchthis = true;
1280 - } elseif( $wgUser->getOption( 'watchcreations' ) && !$this->mTitle->exists() ) {
 1282+ } elseif ( $wgUser->getOption( 'watchcreations' ) && !$this->mTitle->exists() ) {
12811283 # Watch creations
12821284 $this->watchthis = true;
1283 - } elseif( $this->mTitle->userIsWatching() ) {
 1285+ } elseif ( $this->mTitle->userIsWatching() ) {
12841286 # Already watched
12851287 $this->watchthis = true;
12861288 }
12871289
1288 - if( $wgUser->getOption( 'minordefault' ) ) $this->minoredit = true;
 1290+ if ( $wgUser->getOption( 'minordefault' ) ) $this->minoredit = true;
12891291 }
12901292
12911293 $wgOut->addHTML( $this->editFormPageTop );
12921294
1293 - if( $wgUser->getOption( 'previewontop' ) ) {
 1295+ if ( $wgUser->getOption( 'previewontop' ) ) {
12941296 $this->displayPreviewArea( $previewOutput, true );
12951297 }
12961298
@@ -1308,10 +1310,10 @@
13091311 # For a bit more sophisticated detection of blank summaries, hash the
13101312 # automatic one and pass that in the hidden field wpAutoSummary.
13111313 $summaryhiddens = '';
1312 - if( $this->missingSummary ) $summaryhiddens .= Xml::hidden( 'wpIgnoreBlankSummary', true );
 1314+ if ( $this->missingSummary ) $summaryhiddens .= Xml::hidden( 'wpIgnoreBlankSummary', true );
13131315 $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary );
13141316 $summaryhiddens .= Xml::hidden( 'wpAutoSummary', $autosumm );
1315 - if( $this->section == 'new' ) {
 1317+ if ( $this->section == 'new' ) {
13161318 $commentsubject="<span id='wpSummaryLabel'><label for='wpSummary'>{$subject}</label></span>\n<input tabindex='1' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' />{$summaryhiddens}<br />";
13171319 $editsummary = "<div class='editOptions'>\n";
13181320 global $wgParser;
@@ -1326,7 +1328,7 @@
13271329 }
13281330
13291331 # Set focus to the edit box on load, except on preview or diff, where it would interfere with the display
1330 - if( !$this->preview && !$this->diff ) {
 1332+ if ( !$this->preview && !$this->diff ) {
13311333 $wgOut->setOnloadHandler( 'document.editform.wpTextbox1.focus()' );
13321334 }
13331335 $templates = $this->getTemplates();
@@ -1336,13 +1338,13 @@
13371339 $formattedhiddencats = $sk->formatHiddenCategories( $hiddencats );
13381340
13391341 global $wgUseMetadataEdit ;
1340 - if( $wgUseMetadataEdit ) {
 1342+ if ( $wgUseMetadataEdit ) {
13411343 $metadata = $this->mMetaData ;
13421344 $metadata = htmlspecialchars( $wgContLang->recodeForEdit( $metadata ) ) ;
13431345 $top = wfMsgWikiHtml( 'metadata_help' );
13441346 /* ToDo: Replace with clean code */
13451347 $ew = $wgUser->getOption( 'editwidth' );
1346 - if( $ew ) $ew = " style=\"width:100%\"";
 1348+ if ( $ew ) $ew = " style=\"width:100%\"";
13471349 else $ew = '';
13481350 /* /ToDo */
13491351 $metadata = $top . "<textarea name='metadata' rows='3' cols='{$cols}'{$ew}>{$metadata}</textarea>" ;
@@ -1350,8 +1352,8 @@
13511353 else $metadata = "" ;
13521354
13531355 $recreate = '';
1354 - if( $this->wasDeletedSinceLastEdit() ) {
1355 - if( 'save' != $this->formtype ) {
 1356+ if ( $this->wasDeletedSinceLastEdit() ) {
 1357+ if ( 'save' != $this->formtype ) {
13561358 $wgOut->addWikiMsg('deletedwhileediting');
13571359 } else {
13581360 // Hide the toolbar and edit area, use can click preview to get it back
@@ -1383,7 +1385,7 @@
13841386 END
13851387 );
13861388
1387 - if( is_callable( $formCallback ) ) {
 1389+ if ( is_callable( $formCallback ) ) {
13881390 call_user_func_array( $formCallback, array( &$wgOut ) );
13891391 }
13901392
@@ -1447,7 +1449,7 @@
14481450 END
14491451 );
14501452
1451 - if( $this->isConflict && wfRunHooks( 'EditPageBeforeConflictDiff', array( &$this, &$wgOut ) ) ) {
 1453+ if ( $this->isConflict && wfRunHooks( 'EditPageBeforeConflictDiff', array( &$this, &$wgOut ) ) ) {
14521454 $wgOut->wrapWikiMsg( '==$1==', "yourdiff" );
14531455
14541456 $de = new DifferenceEngine( $this->mTitle );
@@ -1459,7 +1461,7 @@
14601462 }
14611463 $wgOut->addHTML( $this->editFormTextBottom );
14621464 $wgOut->addHTML( "</form>\n" );
1463 - if( !$wgUser->getOption( 'previewontop' ) ) {
 1465+ if ( !$wgUser->getOption( 'previewontop' ) ) {
14641466 $this->displayPreviewArea( $previewOutput, false );
14651467 }
14661468
@@ -1478,9 +1480,9 @@
14791481 protected function showTextbox1( $classes ) {
14801482 $attribs = array( 'tabindex' => 1 );
14811483
1482 - if( $this->wasDeletedSinceLastEdit() )
 1484+ if ( $this->wasDeletedSinceLastEdit() )
14831485 $attribs['type'] = 'hidden';
1484 - if( !empty($classes) )
 1486+ if ( !empty($classes) )
14851487 $attribs['class'] = implode(' ',$classes);
14861488
14871489 $this->showTextbox( $this->textbox1, 'wpTextbox1', $attribs );
@@ -1494,7 +1496,7 @@
14951497 global $wgOut, $wgUser;
14961498
14971499 $wikitext = $this->safeUnicodeOutput( $content );
1498 - if( $wikitext !== '' ) {
 1500+ if ( $wikitext !== '' ) {
14991501 // Ensure there's a newline at the end, otherwise adding lines
15001502 // is awkward.
15011503 // But don't add a newline if the ext is empty, or Firefox in XHTML
@@ -1505,7 +1507,7 @@
15061508 $attribs['accesskey'] = ',';
15071509 $attribs['id'] = $name;
15081510
1509 - if( $wgUser->getOption( 'editwidth' ) )
 1511+ if ( $wgUser->getOption( 'editwidth' ) )
15101512 $attribs['style'] = 'width: 100%';
15111513
15121514 $wgOut->addHTML( Xml::textarea(
@@ -1518,23 +1520,23 @@
15191521 protected function displayPreviewArea( $previewOutput, $isOnTop = false ) {
15201522 global $wgOut;
15211523 $classes = array();
1522 - if( $isOnTop )
 1524+ if ( $isOnTop )
15231525 $classes[] = 'ontop';
15241526
15251527 $attribs = array( 'id' => 'wikiPreview', 'class' => implode( ' ', $classes ) );
15261528
1527 - if( $this->formtype != 'preview' )
 1529+ if ( $this->formtype != 'preview' )
15281530 $attribs['style'] = 'display: none;';
15291531
15301532 $wgOut->addHTML( Xml::openElement( 'div', $attribs ) );
15311533
1532 - if( $this->formtype == 'preview' ) {
 1534+ if ( $this->formtype == 'preview' ) {
15331535 $this->showPreview( $previewOutput );
15341536 }
15351537
15361538 $wgOut->addHTML( '</div>' );
15371539
1538 - if( $this->formtype == 'diff') {
 1540+ if ( $this->formtype == 'diff') {
15391541 $this->showDiff();
15401542 }
15411543 }
@@ -1547,14 +1549,14 @@
15481550 */
15491551 protected function showPreview( $text ) {
15501552 global $wgOut;
1551 - if( $this->mTitle->getNamespace() == NS_CATEGORY) {
 1553+ if ( $this->mTitle->getNamespace() == NS_CATEGORY) {
15521554 $this->mArticle->openShowCategory();
15531555 }
15541556 # This hook seems slightly odd here, but makes things more
15551557 # consistent for extensions.
15561558 wfRunHooks( 'OutputPageBeforeHTML',array( &$wgOut, &$text ) );
15571559 $wgOut->addHTML( $text );
1558 - if( $this->mTitle->getNamespace() == NS_CATEGORY ) {
 1560+ if ( $this->mTitle->getNamespace() == NS_CATEGORY ) {
15591561 $this->mArticle->closeShowCategory();
15601562 }
15611563 }
@@ -1587,8 +1589,7 @@
15881590
15891591 function getLastDelete() {
15901592 $dbr = wfGetDB( DB_SLAVE );
1591 - $fname = 'EditPage::getLastDelete';
1592 - $res = $dbr->select(
 1593+ $data = $dbr->selectRow(
15931594 array( 'logging', 'user' ),
15941595 array( 'log_type',
15951596 'log_action',
@@ -1604,14 +1605,9 @@
16051606 'log_type' => 'delete',
16061607 'log_action' => 'delete',
16071608 'user_id=log_user' ),
1608 - $fname,
 1609+ __METHOD__,
16091610 array( 'LIMIT' => 1, 'ORDER BY' => 'log_timestamp DESC' ) );
16101611
1611 - if( $dbr->numRows($res) ) {
1612 - $data = $dbr->fetchObject( $res );
1613 - } else {
1614 - $data = null;
1615 - }
16161612 return $data;
16171613 }
16181614
@@ -1624,8 +1620,8 @@
16251621
16261622 wfProfileIn( __METHOD__ );
16271623
1628 - if( $this->mTriedSave && !$this->mTokenOk ) {
1629 - if( $this->mTokenOkExceptSuffix ) {
 1624+ if ( $this->mTriedSave && !$this->mTokenOk ) {
 1625+ if ( $this->mTokenOkExceptSuffix ) {
16301626 $note = wfMsg( 'token_suffix_mismatch' );
16311627 } else {
16321628 $note = wfMsg( 'session_fail_preview' );
@@ -1638,7 +1634,7 @@
16391635 $parserOptions->setEditSection( false );
16401636
16411637 global $wgRawHtml;
1642 - if( $wgRawHtml && !$this->mTokenOk ) {
 1638+ if ( $wgRawHtml && !$this->mTokenOk ) {
16431639 // Could be an offsite preview attempt. This is very unsafe if
16441640 // HTML is enabled, as it could be an attack.
16451641 return $wgOut->parse( "<div class='previewnote'>" .
@@ -1648,33 +1644,33 @@
16491645 # don't parse user css/js, show message about preview
16501646 # XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here
16511647
1652 - if( $this->isCssJsSubpage ) {
1653 - if(preg_match("/\\.css$/", $this->mTitle->getText() ) ) {
 1648+ if ( $this->isCssJsSubpage ) {
 1649+ if (preg_match("/\\.css$/", $this->mTitle->getText() ) ) {
16541650 $previewtext = wfMsg('usercsspreview');
1655 - } else if(preg_match("/\\.js$/", $this->mTitle->getText() ) ) {
 1651+ } else if (preg_match("/\\.js$/", $this->mTitle->getText() ) ) {
16561652 $previewtext = wfMsg('userjspreview');
16571653 }
16581654 $parserOptions->setTidy(true);
16591655 $parserOutput = $wgParser->parse( $previewtext , $this->mTitle, $parserOptions );
16601656 //$wgOut->addHTML( $parserOutput->mText );
16611657 $previewHTML = '';
1662 - } elseif( $rt = Title::newFromRedirect( $this->textbox1 ) ) {
 1658+ } elseif ( $rt = Title::newFromRedirect( $this->textbox1 ) ) {
16631659 $previewHTML = $this->mArticle->viewRedirect( $rt, false );
16641660 } else {
16651661 $toparse = $this->textbox1;
16661662
16671663 # If we're adding a comment, we need to show the
16681664 # summary as the headline
1669 - if( $this->section=="new" && $this->summary!="" ) {
 1665+ if ( $this->section=="new" && $this->summary!="" ) {
16701666 $toparse="== {$this->summary} ==\n\n".$toparse;
16711667 }
16721668
1673 - if( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData;
 1669+ if ( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData;
16741670
16751671 // Parse mediawiki messages with correct target language
1676 - if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
 1672+ if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
16771673 $pos = strrpos( $this->mTitle->getText(), '/' );
1678 - if( $pos !== false ) {
 1674+ if ( $pos !== false ) {
16791675 $code = substr( $this->mTitle->getText(), $pos+1 );
16801676 switch ($code) {
16811677 case $wgLang->getCode():
@@ -1698,14 +1694,14 @@
16991695 $this->mParserOutput = $parserOutput;
17001696 $wgOut->addParserOutputNoText( $parserOutput );
17011697
1702 - if( count( $parserOutput->getWarnings() ) ) {
 1698+ if ( count( $parserOutput->getWarnings() ) ) {
17031699 $note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() );
17041700 }
17051701 }
17061702
17071703 $previewhead = '<h2>' . htmlspecialchars( wfMsg( 'preview' ) ) . "</h2>\n" .
17081704 "<div class='previewnote'>" . $wgOut->parse( $note ) . "</div>\n";
1709 - if( $this->isConflict ) {
 1705+ if ( $this->isConflict ) {
17101706 $previewhead .='<h2>' . htmlspecialchars( wfMsg( 'previewconflict' ) ) . "</h2>\n";
17111707 }
17121708
@@ -1714,9 +1710,9 @@
17151711 }
17161712
17171713 function getTemplates() {
1718 - if( $this->preview || $this->section != '' ) {
 1714+ if ( $this->preview || $this->section != '' ) {
17191715 $templates = array();
1720 - if( !isset($this->mParserOutput) ) return $templates;
 1716+ if ( !isset($this->mParserOutput) ) return $templates;
17211717 foreach( $this->mParserOutput->getTemplates() as $ns => $template) {
17221718 foreach( array_keys( $template ) as $dbk ) {
17231719 $templates[] = Title::makeTitle($ns, $dbk);
@@ -1738,14 +1734,14 @@
17391735 # If the user made changes, preserve them when showing the markup
17401736 # (This happens when a user is blocked during edit, for instance)
17411737 $first = $this->firsttime || ( !$this->save && $this->textbox1 == '' );
1742 - if( $first ) {
 1738+ if ( $first ) {
17431739 $source = $this->mTitle->exists() ? $this->getContent() : false;
17441740 } else {
17451741 $source = $this->textbox1;
17461742 }
17471743
17481744 # Spit out the source or the user's modified version
1749 - if( $source !== false ) {
 1745+ if ( $source !== false ) {
17501746 $rows = $wgUser->getIntOption( 'rows' );
17511747 $cols = $wgUser->getIntOption( 'cols' );
17521748 $attribs = array( 'id' => 'wpTextbox1', 'name' => 'wpTextbox1', 'cols' => $cols, 'rows' => $rows, 'readonly' => 'readonly' );
@@ -1804,7 +1800,7 @@
18051801
18061802 $wgOut->addHtml( '<div id="spamprotected">' );
18071803 $wgOut->addWikiMsg( 'spamprotectiontext' );
1808 - if( $match )
 1804+ if ( $match )
18091805 $wgOut->addWikiMsg( 'spamprotectionmatch', wfEscapeWikiText( $match ) );
18101806 $wgOut->addHtml( '</div>' );
18111807
@@ -1823,7 +1819,7 @@
18241820
18251821 // This is the revision the editor started from
18261822 $baseRevision = $this->getBaseRevision();
1827 - if( is_null( $baseRevision ) ) {
 1823+ if ( is_null( $baseRevision ) ) {
18281824 wfProfileOut( $fname );
18291825 return false;
18301826 }
@@ -1832,14 +1828,14 @@
18331829 // The current state, we want to merge updates into it
18341830 $currentRevision = Revision::loadFromTitle(
18351831 $db, $this->mTitle );
1836 - if( is_null( $currentRevision ) ) {
 1832+ if ( is_null( $currentRevision ) ) {
18371833 wfProfileOut( $fname );
18381834 return false;
18391835 }
18401836 $currentText = $currentRevision->getText();
18411837
18421838 $result = '';
1843 - if( wfMerge( $baseText, $editText, $currentText, $result ) ) {
 1839+ if ( wfMerge( $baseText, $editText, $currentText, $result ) ) {
18441840 $editText = $result;
18451841 wfProfileOut( $fname );
18461842 return true;
@@ -1858,13 +1854,13 @@
18591855 */
18601856 function checkUnicodeCompliantBrowser() {
18611857 global $wgBrowserBlackList;
1862 - if( empty( $_SERVER["HTTP_USER_AGENT"] ) ) {
 1858+ if ( empty( $_SERVER["HTTP_USER_AGENT"] ) ) {
18631859 // No User-Agent header sent? Trust it by default...
18641860 return true;
18651861 }
18661862 $currentbrowser = $_SERVER["HTTP_USER_AGENT"];
18671863 foreach ( $wgBrowserBlackList as $browser ) {
1868 - if( preg_match($browser, $currentbrowser) ) {
 1864+ if ( preg_match($browser, $currentbrowser) ) {
18691865 return false;
18701866 }
18711867 }
@@ -2057,7 +2053,7 @@
20582054
20592055 $checkboxes['minor'] = '';
20602056 $minorLabel = wfMsgExt('minoredit', array('parseinline'));
2061 - if( $wgUser->isAllowed('minoredit') ) {
 2057+ if ( $wgUser->isAllowed('minoredit') ) {
20622058 $attribs = array(
20632059 'tabindex' => ++$tabindex,
20642060 'accesskey' => wfMsg( 'accesskey-minoredit' ),
@@ -2070,7 +2066,7 @@
20712067
20722068 $watchLabel = wfMsgExt('watchthis', array('parseinline'));
20732069 $checkboxes['watch'] = '';
2074 - if( $wgUser->isLoggedIn() ) {
 2070+ if ( $wgUser->isLoggedIn() ) {
20752071 $attribs = array(
20762072 'tabindex' => ++$tabindex,
20772073 'accesskey' => wfMsg( 'accesskey-watch' ),
@@ -2108,7 +2104,7 @@
21092105 $buttons['save'] = Xml::element('input', $temp, '');
21102106
21112107 ++$tabindex; // use the same for preview and live preview
2112 - if( $wgLivePreview && $wgUser->getOption( 'uselivepreview' ) ) {
 2108+ if ( $wgLivePreview && $wgUser->getOption( 'uselivepreview' ) ) {
21132109 $temp = array(
21142110 'id' => 'wpPreview',
21152111 'name' => 'wpPreview',
@@ -2206,7 +2202,7 @@
22072203 $newtext = $this->mArticle->preSaveTransform( $newtext );
22082204 $oldtitle = wfMsgExt( 'currentrev', array('parseinline') );
22092205 $newtitle = wfMsgExt( 'yourtext', array('parseinline') );
2210 - if( $oldtext !== false || $newtext != '' ) {
 2206+ if ( $oldtext !== false || $newtext != '' ) {
22112207 $de = new DifferenceEngine( $this->mTitle );
22122208 $de->setText( $oldtext, $newtext );
22132209 $difftext = $de->getDiff( $oldtitle, $newtitle );
@@ -2273,20 +2269,20 @@
22742270 $working = 0;
22752271 for( $i = 0; $i < strlen( $invalue ); $i++ ) {
22762272 $bytevalue = ord( $invalue{$i} );
2277 - if( $bytevalue <= 0x7F ) { //0xxx xxxx
 2273+ if ( $bytevalue <= 0x7F ) { //0xxx xxxx
22782274 $result .= chr( $bytevalue );
22792275 $bytesleft = 0;
2280 - } elseif( $bytevalue <= 0xBF ) { //10xx xxxx
 2276+ } elseif ( $bytevalue <= 0xBF ) { //10xx xxxx
22812277 $working = $working << 6;
22822278 $working += ($bytevalue & 0x3F);
22832279 $bytesleft--;
2284 - if( $bytesleft <= 0 ) {
 2280+ if ( $bytesleft <= 0 ) {
22852281 $result .= "&#x" . strtoupper( dechex( $working ) ) . ";";
22862282 }
2287 - } elseif( $bytevalue <= 0xDF ) { //110x xxxx
 2283+ } elseif ( $bytevalue <= 0xDF ) { //110x xxxx
22882284 $working = $bytevalue & 0x1F;
22892285 $bytesleft = 1;
2290 - } elseif( $bytevalue <= 0xEF ) { //1110 xxxx
 2286+ } elseif ( $bytevalue <= 0xEF ) { //1110 xxxx
22912287 $working = $bytevalue & 0x0F;
22922288 $bytesleft = 2;
22932289 } else { //1111 0xxx
@@ -2309,7 +2305,7 @@
23102306 function unmakesafe( $invalue ) {
23112307 $result = "";
23122308 for( $i = 0; $i < strlen( $invalue ); $i++ ) {
2313 - if( ( substr( $invalue, $i, 3 ) == "&#x" ) && ( $invalue{$i+3} != '0' ) ) {
 2309+ if ( ( substr( $invalue, $i, 3 ) == "&#x" ) && ( $invalue{$i+3} != '0' ) ) {
23142310 $i += 3;
23152311 $hexstring = "";
23162312 do {
@@ -2320,7 +2316,7 @@
23212317 // Do some sanity checks. These aren't needed for reversability,
23222318 // but should help keep the breakage down if the editor
23232319 // breaks one of the entities whilst editing.
2324 - if( (substr($invalue,$i,1)==";") and (strlen($hexstring) <= 6) ) {
 2320+ if ( (substr($invalue,$i,1)==";") and (strlen($hexstring) <= 6) ) {
23252321 $codepoint = hexdec($hexstring);
23262322 $result .= codepointToUtf8( $codepoint );
23272323 } else {
@@ -2347,21 +2343,19 @@
23482344 * @param OutputPage $out
23492345 */
23502346 protected function showDeletionLog( $out ) {
2351 - if( !$this->mTitle->exists() ) {
2352 - global $wgUser;
2353 - $loglist = new LogEventsList( $wgUser->getSkin(), $out );
2354 - $pager = new LogPager( $loglist, 'delete', false, $this->mTitle->getPrefixedText() );
2355 - if( $pager->getNumRows() > 0 ) {
2356 - $out->addHtml( '<div id="mw-recreate-deleted-warn">' );
2357 - $out->addWikiMsg( 'recreate-deleted-warn' );
2358 - $out->addHTML(
2359 - $loglist->beginLogEventsList() .
2360 - $pager->getBody() .
2361 - $loglist->endLogEventsList()
2362 - );
2363 - $out->addHtml( '</div>' );
2364 - return true;
2365 - }
 2347+ global $wgUser;
 2348+ $loglist = new LogEventsList( $wgUser->getSkin(), $out );
 2349+ $pager = new LogPager( $loglist, 'delete', false, $this->mTitle->getPrefixedText() );
 2350+ if ( $pager->getNumRows() > 0 ) {
 2351+ $out->addHtml( '<div id="mw-recreate-deleted-warn">' );
 2352+ $out->addWikiMsg( 'recreate-deleted-warn' );
 2353+ $out->addHTML(
 2354+ $loglist->beginLogEventsList() .
 2355+ $pager->getBody() .
 2356+ $loglist->endLogEventsList()
 2357+ );
 2358+ $out->addHtml( '</div>' );
 2359+ return true;
23662360 }
23672361 return false;
23682362 }
@@ -2376,7 +2370,7 @@
23772371 $resultDetails = false;
23782372 $value = $this->internalAttemptSave( $resultDetails, $wgUser->isAllowed('bot') && $wgRequest->getBool('bot', true) );
23792373
2380 - if( $value == self::AS_SUCCESS_UPDATE || $value == self::AS_SUCCESS_NEW_ARTICLE ) {
 2374+ if ( $value == self::AS_SUCCESS_UPDATE || $value == self::AS_SUCCESS_NEW_ARTICLE ) {
23812375 $this->didSave = true;
23822376 }
23832377
@@ -2437,7 +2431,7 @@
24382432 }
24392433
24402434 function getBaseRevision() {
2441 - if( $this->mBaseRevision == false ) {
 2435+ if ( $this->mBaseRevision == false ) {
24422436 $db = wfGetDB( DB_MASTER );
24432437 $baseRevision = Revision::loadFromTimestamp(
24442438 $db, $this->mTitle, $this->edittime );

Follow-up revisions

RevisionCommit summaryAuthorDate
r40921*Re-implement r40723 in Article::view()...mrzman18:31, 16 September 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r40674Add the list of restrictions to the "titleprotectedwarning" message. For now,...ialex19:53, 9 September 2008