Fixed stream resources

This commit is contained in:
Simon Wisselink
2023-01-07 23:22:58 +01:00
parent fd64cc688a
commit e1d395e140

View File

@@ -88,16 +88,6 @@ abstract class BasePlugin
$_resource_class = 'Smarty_Resource_' . \smarty_ucfirst_ascii($type);
if (class_exists($_resource_class, false)) {
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
$_known_stream = stream_get_wrappers();
@@ -106,7 +96,7 @@ abstract class BasePlugin
if (is_object($smarty->security_policy)) {
$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
// give up