diff --git a/src/Smarty.php b/src/Smarty.php index b53a36c20..e6132f5a2 100644 --- a/src/Smarty.php +++ b/src/Smarty.php @@ -1487,7 +1487,7 @@ protected function compileAll( // $_smarty->force_compile = $force_compile; try { - $_tpl = $this->doCreateTemplate($_file); + $_tpl = $_smarty->doCreateTemplate($_file); $_tpl->caching = self::CACHING_OFF; $_tpl->setSource( $isConfig ? \Smarty\Template\Config::load($_tpl) : \Smarty\Template\Source::load($_tpl) @@ -1507,7 +1507,7 @@ protected function compileAll( } // free memory unset($_tpl); - if ($max_errors !== null && $_error_count === $max_errors) { + if ($max_errors !== null && $_error_count > $max_errors) { echo "\ntoo many errors\n"; exit(1); }