mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 01:44:26 +02:00
Fixed stream resources
This commit is contained in:
@@ -88,16 +88,6 @@ abstract class BasePlugin
|
|||||||
$_resource_class = 'Smarty_Resource_' . \smarty_ucfirst_ascii($type);
|
$_resource_class = 'Smarty_Resource_' . \smarty_ucfirst_ascii($type);
|
||||||
if (class_exists($_resource_class, false)) {
|
if (class_exists($_resource_class, false)) {
|
||||||
return $smarty->_resource_handlers[ $type ] = new $_resource_class();
|
return $smarty->_resource_handlers[ $type ] = new $_resource_class();
|
||||||
} else {
|
|
||||||
$smarty->registerResource(
|
|
||||||
$type,
|
|
||||||
array(
|
|
||||||
"smarty_resource_{$type}_source", "smarty_resource_{$type}_timestamp",
|
|
||||||
"smarty_resource_{$type}_secure", "smarty_resource_{$type}_trusted"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
// give it another try, now that the resource is registered properly
|
|
||||||
return self::load($smarty, $type);
|
|
||||||
}
|
}
|
||||||
// try streams
|
// try streams
|
||||||
$_known_stream = stream_get_wrappers();
|
$_known_stream = stream_get_wrappers();
|
||||||
@@ -106,7 +96,7 @@ abstract class BasePlugin
|
|||||||
if (is_object($smarty->security_policy)) {
|
if (is_object($smarty->security_policy)) {
|
||||||
$smarty->security_policy->isTrustedStream($type);
|
$smarty->security_policy->isTrustedStream($type);
|
||||||
}
|
}
|
||||||
return $smarty->_resource_handlers[ $type ] = new Stream();
|
return $smarty->_resource_handlers[ $type ] = new StreamPlugin();
|
||||||
}
|
}
|
||||||
// TODO: try default_(template|config)_handler
|
// TODO: try default_(template|config)_handler
|
||||||
// give up
|
// give up
|
||||||
|
Reference in New Issue
Block a user