Deprecate stream variables

This commit is contained in:
Simon Wisselink
2024-02-14 21:58:30 +01:00
parent 15e48b6af3
commit 46e571fedd
2 changed files with 6 additions and 0 deletions

View File

@@ -10,4 +10,7 @@ template.
{$foo:bar} {$foo:bar}
``` ```
NB. Support for using streams to call variables is deprecated since Smarty v5.1 and will be removed
in a future version.
See also [`Template Resources`](../resources.md) See also [`Template Resources`](../resources.md)

View File

@@ -555,6 +555,9 @@ class Template extends TemplateBase {
*/ */
public function getStreamVariable($variable) public function getStreamVariable($variable)
{ {
trigger_error("Using stream variables (\`\{\$foo:bar\}\`)is deprecated.", E_USER_DEPRECATED);
$_result = ''; $_result = '';
$fp = fopen($variable, 'r+'); $fp = fopen($variable, 'r+');
if ($fp) { if ($fp) {