r81891 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81890‎ | r81891 | r81892 >
Date:15:53, 10 February 2011
Author:platonides
Status:ok
Tags:
Comment:
Close wfProfileIn()s
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -795,6 +795,8 @@
796796
797797 if ( !wfRunHooks( 'EditPage::attemptSave', array( $this ) ) ) {
798798 wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" );
 799+ wfProfileOut( __METHOD__ . '-checks' );
 800+ wfProfileOut( __METHOD__ );
799801 return self::AS_HOOK_ERROR;
800802 }
801803
@@ -802,11 +804,12 @@
803805 if ( $this->mTitle->getNamespace() == NS_FILE &&
804806 Title::newFromRedirect( $this->textbox1 ) instanceof Title &&
805807 !$wgUser->isAllowed( 'upload' ) ) {
806 - if ( $wgUser->isAnon() ) {
807 - return self::AS_IMAGE_REDIRECT_ANON;
808 - } else {
809 - return self::AS_IMAGE_REDIRECT_LOGGED;
810 - }
 808+ $isAnon = $wgUser->isAnon();
 809+
 810+ wfProfileOut( __METHOD__ . '-checks' );
 811+ wfProfileOut( __METHOD__ );
 812+
 813+ return $isAnon ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED;
811814 }
812815
813816 # Check for spam
@@ -1255,8 +1258,10 @@
12561259 # Enabled article-related sidebar, toplinks, etc.
12571260 $wgOut->setArticleRelated( true );
12581261
1259 - if ( $this->showHeader() === false )
 1262+ if ( $this->showHeader() === false ) {
 1263+ wfProfileOut( __METHOD__ );
12601264 return;
 1265+ }
12611266
12621267 $action = htmlspecialchars( $this->getActionURL( $wgTitle ) );
12631268
@@ -1910,8 +1915,10 @@
19111916 if ( $wgRawHtml && !$this->mTokenOk ) {
19121917 // Could be an offsite preview attempt. This is very unsafe if
19131918 // HTML is enabled, as it could be an attack.
1914 - return $wgOut->parse( "<div class='previewnote'>" .
 1919+ $parsedNote = $wgOut->parse( "<div class='previewnote'>" .
19151920 wfMsg( 'session_fail_preview_html' ) . "</div>" );
 1921+ wfProfileOut( __METHOD__ );
 1922+ return $parsedNote;
19161923 }
19171924
19181925 # don't parse user css/js, show message about preview

Follow-up revisions

RevisionCommit summaryAuthorDate
r819211.17wmf1: MFT r81729, r81890, r81891, r81892, r81893, r81894, r81896, r81897,...catrope22:42, 10 February 2011
r85148MFT: r80495, r80610, r80765, r81177, r81490, r81692, r81707, r81729, r81765, ...demon20:11, 1 April 2011

Status & tagging log