diff --git a/NEWS b/NEWS index bb507e74..8b306998 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - added index key example to QUICKSTART guide (Monte) + Version 1.4.6 ------------- - fixed bug with {assign ...} when passing an empty value. (Monte) diff --git a/Smarty.class.php b/Smarty.class.php index 360a6ebc..b41c9751 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -1070,7 +1070,7 @@ function _run_mod_handler() function _read_file($filename) { - if (!($fd = fopen($filename, 'r'))) { + if (!($fd = @fopen($filename, 'r'))) { $this->_trigger_error_msg("problem reading '$filename.'"); return false; } @@ -1089,7 +1089,7 @@ function _run_mod_handler() if ($create_dirs) $this->_create_dir_structure(dirname($filename)); - if (!($fd = fopen($filename, 'w'))) { + if (!($fd = @fopen($filename, 'w'))) { $this->_trigger_error_msg("problem writing '$filename.'"); return false; } @@ -1227,6 +1227,10 @@ function _run_mod_handler() { $results = $this->_read_file($cache_file); + if(empty($results)) { + return false; + } + // get the files involved with this cache from the first line $contents = explode("\n", $results, 2); diff --git a/demo/index.php b/demo/index.php index 5acebb36..549a5953 100644 --- a/demo/index.php +++ b/demo/index.php @@ -1,7 +1,5 @@ compile_check = true; diff --git a/index.php b/index.php index 5acebb36..549a5953 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,5 @@ compile_check = true; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 360a6ebc..b41c9751 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1070,7 +1070,7 @@ function _run_mod_handler() function _read_file($filename) { - if (!($fd = fopen($filename, 'r'))) { + if (!($fd = @fopen($filename, 'r'))) { $this->_trigger_error_msg("problem reading '$filename.'"); return false; } @@ -1089,7 +1089,7 @@ function _run_mod_handler() if ($create_dirs) $this->_create_dir_structure(dirname($filename)); - if (!($fd = fopen($filename, 'w'))) { + if (!($fd = @fopen($filename, 'w'))) { $this->_trigger_error_msg("problem writing '$filename.'"); return false; } @@ -1227,6 +1227,10 @@ function _run_mod_handler() { $results = $this->_read_file($cache_file); + if(empty($results)) { + return false; + } + // get the files involved with this cache from the first line $contents = explode("\n", $results, 2);