- 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 =====
14/05/2011
- bugfix fopen() error handling at stream resources
- bugfix error handling at stream resources
13/05/2011
- bugfix condition starting with "-" did fail at {if} and {while} tags

View File

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

View File

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