r83698 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83697‎ | r83698 | r83699 >
Date:14:31, 11 March 2011
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
Only call User::getSkin() when necessary.

(With this, a parser cache hit on action=render may not load the skin at all)
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -1785,8 +1785,6 @@
17861786 }
17871787 }
17881788
1789 - $sk = $wgUser->getSkin();
1790 -
17911789 // Add base resources
17921790 $this->addModules( 'mediawiki.util' );
17931791 global $wgIncludeLegacyJavaScript;
@@ -1849,6 +1847,8 @@
18501848 if ( $this->mArticleBodyOnly ) {
18511849 $this->out( $this->mBodytext );
18521850 } else {
 1851+ $sk = $wgUser->getSkin();
 1852+
18531853 // Hook that allows last minute changes to the output page, e.g.
18541854 // adding of CSS or Javascript by extensions.
18551855 wfRunHooks( 'BeforePageDisplay', array( &$this, &$sk ) );
Index: trunk/phase3/includes/Article.php
@@ -1216,13 +1216,12 @@
12171217 global $wgOut, $wgUser, $wgRequest, $wgRedirectSources;
12181218
12191219 $rdfrom = $wgRequest->getVal( 'rdfrom' );
1220 - $sk = $wgUser->getSkin();
12211220
12221221 if ( isset( $this->mRedirectedFrom ) ) {
12231222 // This is an internally redirected page view.
12241223 // We'll need a backlink to the source page for navigation.
12251224 if ( wfRunHooks( 'ArticleViewRedirect', array( &$this ) ) ) {
1226 - $redir = $sk->link(
 1225+ $redir = $wgUser->getSkin()->link(
12271226 $this->mRedirectedFrom,
12281227 null,
12291228 array(),
@@ -1250,7 +1249,7 @@
12511250 // This is an externally redirected view, from some other wiki.
12521251 // If it was reported from a trusted site, supply a backlink.
12531252 if ( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) {
1254 - $redir = $sk->makeExternalLink( $rdfrom, $rdfrom );
 1253+ $redir = $wgUser->getSkin()->makeExternalLink( $rdfrom, $rdfrom );
12551254 $s = wfMsgExt( 'redirectedfrom', array( 'parseinline', 'replaceafter' ), $redir );
12561255 $wgOut->setSubtitle( $s );
12571256

Follow-up revisions

RevisionCommit summaryAuthorDate
r83820Fix for r83698: pass the Title object to the skin so that we are sure to show...ialex11:24, 13 March 2011

Comments

#Comment by Siebrand (talk | contribs)   23:10, 12 March 2011

Pages transcluding special:prefixindex are now identified as special pages.

Status & tagging log