From: Alex Z Date: Thu, 9 Oct 2008 21:08:42 +0000 (+0000) Subject: Fix some profiling errors in wfGetSiteNotice() if no sitenotice is defined X-Git-Tag: 1.31.0-rc.0~44827 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=098f276067b6c01aef89568ba3402756e9741e7a;p=lhc%2Fweb%2Fwiklou.git Fix some profiling errors in wfGetSiteNotice() if no sitenotice is defined --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 4c527c8115..1bbf4b9976 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1879,14 +1879,18 @@ function wfGetSiteNotice() { if( $wgUser instanceOf User && $wgUser->isLoggedIn() ) { $loggedIn = true; $siteNotice = wfGetCachedNotice('sitenotice'); - if($siteNotice === false) + if($siteNotice === false) { + wfProfileOut( $fname ); return ''; + } } else { $siteNotice = wfGetCachedNotice('anonnotice'); if($siteNotice === false) { $siteNotice = wfGetCachedNotice('sitenotice'); - if($siteNotice === false) + if($siteNotice === false) { + wfProfileOut( $fname ); return ''; + } } } @@ -1896,8 +1900,10 @@ function wfGetSiteNotice() { if( wfRunHooks( 'SiteNoticeBefore', array( &$siteNotice ) ) ) { if( $loggedIn ) { //it is hidden - if( isset($_COOKIE[$wgCookiePrefix . 'DismissSiteNotice']) && $_COOKIE[$wgCookiePrefix . 'DismissSiteNotice'] == $id ) + if( isset($_COOKIE[$wgCookiePrefix . 'DismissSiteNotice']) && $_COOKIE[$wgCookiePrefix . 'DismissSiteNotice'] == $id ) { + wfProfileOut( $fname ); return ''; + } $siteNotice = <<$siteNotice [$msgClose]