r41896 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41895‎ | r41896 | r41897 >
Date:21:08, 9 October 2008
Author:mrzman
Status:old (Comments)
Tags:
Comment:
Fix some profiling errors in wfGetSiteNotice() if no sitenotice is defined
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1879,14 +1879,18 @@
18801880 if( $wgUser instanceOf User && $wgUser->isLoggedIn() ) {
18811881 $loggedIn = true;
18821882 $siteNotice = wfGetCachedNotice('sitenotice');
1883 - if($siteNotice === false)
 1883+ if($siteNotice === false) {
 1884+ wfProfileOut( $fname );
18841885 return '';
 1886+ }
18851887 } else {
18861888 $siteNotice = wfGetCachedNotice('anonnotice');
18871889 if($siteNotice === false) {
18881890 $siteNotice = wfGetCachedNotice('sitenotice');
1889 - if($siteNotice === false)
 1891+ if($siteNotice === false) {
 1892+ wfProfileOut( $fname );
18901893 return '';
 1894+ }
18911895 }
18921896 }
18931897
@@ -1896,8 +1900,10 @@
18971901 if( wfRunHooks( 'SiteNoticeBefore', array( &$siteNotice ) ) ) {
18981902 if( $loggedIn ) {
18991903 //it is hidden
1900 - if( isset($_COOKIE[$wgCookiePrefix . 'DismissSiteNotice']) && $_COOKIE[$wgCookiePrefix . 'DismissSiteNotice'] == $id )
 1904+ if( isset($_COOKIE[$wgCookiePrefix . 'DismissSiteNotice']) && $_COOKIE[$wgCookiePrefix . 'DismissSiteNotice'] == $id ) {
 1905+ wfProfileOut( $fname );
19011906 return '';
 1907+ }
19021908 $siteNotice = <<<EOT
19031909 <table width="100%" id="mw-dismissable-notice"><tr><td width="80%">$siteNotice</td>
19041910 <td width="20%" align="right">[<a id="dismissLink" href="$spUrl">$msgClose</a>]</td></tr></table>

Comments

#Comment by Tim Starling (talk | contribs)   04:48, 11 October 2008

Reverted in r41958.

Status & tagging log