From 21e07daf6d1b5e4204e4dc2496a5929b62cf802d Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Sun, 12 Jul 2015 02:26:42 +0200 Subject: [PATCH] optimization --- libs/sysplugins/smarty_internal_resource_file.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/sysplugins/smarty_internal_resource_file.php b/libs/sysplugins/smarty_internal_resource_file.php index 92b1a97e..3d241e70 100644 --- a/libs/sysplugins/smarty_internal_resource_file.php +++ b/libs/sysplugins/smarty_internal_resource_file.php @@ -172,10 +172,8 @@ class Smarty_Internal_Resource_File extends Smarty_Resource if ($source->exists) { return file_get_contents($source->filepath); } - if ($source instanceof Smarty_Template_Config) { - throw new SmartyException("Unable to read config {$source->type} '{$source->name}'"); - } - throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); + throw new SmartyException('Unable to read ' . ($source->isConfig ? 'config' : 'template') . + " {$source->type} '{$source->name}'"); } /**