diff --git a/application/helpers/siteinfo_helper.php b/application/helpers/siteinfo_helper.php index 5a532d1003..cf97ccae39 100755 --- a/application/helpers/siteinfo_helper.php +++ b/application/helpers/siteinfo_helper.php @@ -31,9 +31,13 @@ function siteinfo($name = NULL) { if (0 !== strpos($name, 'siteinfo_')) { $name = 'siteinfo_' . $name; } - $ci = &get_instance(); - $ci->load->library('SiteInfo'); - $siteinfo = new SiteInfo(); + + static $siteinfo; + if ( empty( $siteinfo ) ) { + $ci = &get_instance(); + $ci->load->library('SiteInfo'); + $siteinfo = new SiteInfo(); + } // next code is only for compatibility with older versions of library, // so in the future needed to be removed (with funciton processOldVersions() too) @@ -67,7 +71,10 @@ function siteInfoAdditionalManipulations($name) { $name = str_replace('_url', '', $name); } - $siteinfo = new SiteInfo(); + static $siteinfo; + if ( empty( $siteinfo ) ) { + $siteinfo = new SiteInfo(); + } $value = $siteinfo->getSiteInfo($name); switch ($name) { case 'siteinfo_favicon': @@ -103,4 +110,4 @@ function siteInfoAdditionalManipulations($name) { return false; } -} \ No newline at end of file +}