X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FSmarty.php;h=483ef374baea205eac63e6b072809ea1c10630c4;hb=b7fefa314f0ed3924a2d68cae11532f9a0664952;hp=c7476e9b94f425b50df82749d35b01f8582cfdf2;hpb=8316756f6792de45b65b294d763f0705564f44e8;p=civicrm-core.git diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index c7476e9b94..483ef374ba 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -176,15 +176,22 @@ class CRM_Core_Smarty extends Smarty { * @param bool $display * * @return bool|mixed|string + * + * @noinspection PhpDocMissingThrowsInspection + * @noinspection PhpUnhandledExceptionInspection */ public function fetch($resource_name, $cache_id = NULL, $compile_id = NULL, $display = FALSE) { if (preg_match('/^(\s+)?string:/', $resource_name)) { $old_security = $this->security; $this->security = TRUE; } - $output = parent::fetch($resource_name, $cache_id, $compile_id, $display); - if (isset($old_security)) { - $this->security = $old_security; + try { + $output = parent::fetch($resource_name, $cache_id, $compile_id, $display); + } + finally { + if (isset($old_security)) { + $this->security = $old_security; + } } return $output; }