mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
- bugfix fopen() error handling at stream resources
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user