- bugfix fopen() error handling at stream resources

This commit is contained in:
uwe.tews@googlemail.com
2011-05-14 10:18:10 +00:00
parent 184557ed46
commit 86586e5af4
2 changed files with 59 additions and 54 deletions

View File

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

View File

@@ -1,18 +1,18 @@
<?php
/**
* Smarty Internal Plugin Resource Stream
*
* Implements the streams as resource for Smarty template
*
* @package Smarty
* @subpackage TemplateResources
* @author Uwe Tews
*/
* Smarty Internal Plugin Resource Stream
*
* Implements the streams as resource for Smarty template
*
* @package Smarty
* @subpackage TemplateResources
* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Resource Stream
*/
* Smarty Internal Plugin Resource Stream
*/
class Smarty_Internal_Resource_Stream {
public function __construct($smarty)
{
@@ -74,13 +74,15 @@ class Smarty_Internal_Resource_Stream {
{
// return template string
$_template->template_source = '';
$fp = fopen(str_replace(':', '://', $_template->template_resource),'r+');
if ($fp = fopen(str_replace(':', '://', $_template->template_resource),'r+')) {
while (!feof($fp)) {
$_template->template_source .= fgets($fp);
}
fclose($fp);
return true;
} else {
return false;
}
}
/**