- bugfix error handling at stream resources

This commit is contained in:
uwe.tews@googlemail.com
2011-05-14 11:11:52 +00:00
parent 86586e5af4
commit 7c0e3c89c1
3 changed files with 110 additions and 110 deletions

View File

@@ -1,6 +1,6 @@
===== SVN trunk ===== ===== SVN trunk =====
14/05/2011 14/05/2011
- bugfix fopen() error handling at stream resources - bugfix error handling at stream resources
13/05/2011 13/05/2011
- bugfix condition starting with "-" did fail at {if} and {while} tags - bugfix condition starting with "-" did fail at {if} and {while} tags

View File

@@ -329,8 +329,8 @@ class Smarty_Internal_Data {
{ {
$_result = ''; $_result = '';
if ($fp = fopen($variable, 'r+')) { if ($fp = fopen($variable, 'r+')) {
while (!feof($fp)) { while (!feof($fp) && ($current_line = fgets($fp)) !== false ) {
$_result .= fgets($fp); $_result .= $current_line;
} }
fclose($fp); fclose($fp);
return $_result; return $_result;

View File

@@ -75,8 +75,8 @@ class Smarty_Internal_Resource_Stream {
// return template string // return template string
$_template->template_source = ''; $_template->template_source = '';
if ($fp = fopen(str_replace(':', '://', $_template->template_resource),'r+')) { if ($fp = fopen(str_replace(':', '://', $_template->template_resource),'r+')) {
while (!feof($fp)) { while (!feof($fp) && ($current_line = fgets($fp)) !== false ) {
$_template->template_source .= fgets($fp); $_template->template_source .= $current_line;
} }
fclose($fp); fclose($fp);
return true; return true;