mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- bugfix fopen() error handling at stream resources
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== SVN trunk =====
|
===== SVN trunk =====
|
||||||
|
14/05/2011
|
||||||
|
- bugfix fopen() 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
|
||||||
|
|
||||||
|
@@ -1,18 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty Internal Plugin Resource Stream
|
* Smarty Internal Plugin Resource Stream
|
||||||
*
|
*
|
||||||
* Implements the streams as resource for Smarty template
|
* Implements the streams as resource for Smarty template
|
||||||
*
|
*
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @subpackage TemplateResources
|
* @subpackage TemplateResources
|
||||||
* @author Uwe Tews
|
* @author Uwe Tews
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smarty Internal Plugin Resource Stream
|
* Smarty Internal Plugin Resource Stream
|
||||||
*/
|
*/
|
||||||
class Smarty_Internal_Resource_Stream {
|
class Smarty_Internal_Resource_Stream {
|
||||||
public function __construct($smarty)
|
public function __construct($smarty)
|
||||||
{
|
{
|
||||||
@@ -74,13 +74,15 @@ class Smarty_Internal_Resource_Stream {
|
|||||||
{
|
{
|
||||||
// return template string
|
// return template string
|
||||||
$_template->template_source = '';
|
$_template->template_source = '';
|
||||||
$fp = fopen(str_replace(':', '://', $_template->template_resource),'r+');
|
if ($fp = fopen(str_replace(':', '://', $_template->template_resource),'r+')) {
|
||||||
while (!feof($fp)) {
|
while (!feof($fp)) {
|
||||||
$_template->template_source .= fgets($fp);
|
$_template->template_source .= fgets($fp);
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user