From 098f276067b6c01aef89568ba3402756e9741e7a Mon Sep 17 00:00:00 2001 From: Alex Z Date: Thu, 9 Oct 2008 21:08:42 +0000 Subject: [PATCH] Fix some profiling errors in wfGetSiteNotice() if no sitenotice is defined --- includes/GlobalFunctions.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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] -- 2.20.1