issue #1845 update Smarty from 4.1.0 to 4.3.1 (compat PHP 8.2)

This commit is contained in:
plegall
2023-04-17 10:49:21 +02:00
parent ea53750bfe
commit 7752138b04
186 changed files with 4513 additions and 4665 deletions
@@ -14,4 +14,4 @@ auto\_literal to false.
:::
See also [Escaping Smarty Parsing](#language.escaping),
See also [Escaping Smarty parsing](#language.escaping),
@@ -13,6 +13,9 @@ changing), the compile check step is no longer needed. Be sure to set
change this to FALSE and a template file is changed, you will \*not\*
see the change since the template will not get recompiled.
Note that up to Smarty 4.x, Smarty will check for the existence of
the source template even if `$compile_check` is disabled.
If [`$caching`](#variable.caching) is enabled and `$compile_check` is
enabled, then the cache files will get regenerated if an involved
template file or config file was updated.
@@ -1,7 +1,7 @@
\$compile\_id {#variable.compile.id}
=============
Persistant compile identifier. As an alternative to passing the same
Persistent compile identifier. As an alternative to passing the same
`$compile_id` to each and every function call, you can set this
`$compile_id` and it will be used implicitly thereafter.
@@ -10,7 +10,7 @@ post-filters](#plugins.prefilters.postfilters) you must use a unique
`$compile_id` to keep the compiled template files separated.
For example a [prefilter](#plugins.prefilters.postfilters) that
localizes your templates (that is: translates language dependend parts)
localizes your templates (that is: translates language dependent parts)
at compile time, then you could use the current language as
`$compile_id` and you will get a set of compiled templates for each
language you use.
@@ -2,7 +2,7 @@
==================
When this value is set to a non-null-value it\'s value is used as php\'s
[`error_reporting`](&url.php-manual;error_reporting) level inside of
[`error_reporting`](https://www.php.net/error_reporting) level inside of
[`display()`](#api.display) and [`fetch()`](#api.fetch).
Smarty 3.1.2 introduced the
@@ -3,7 +3,7 @@
Setting `$escape_html` to TRUE will escape all template variable output
by wrapping it in
`htmlspecialchars({$output}, ENT_QUOTES, SMARTY_RESOURCE_CHAR_SET);`,
`htmlspecialchars({$output}, ENT_QUOTES, $char_set);`,
which is the same as `{$variable|escape:"html"}`.
Template designers can choose to selectively disable this feature by
@@ -2,6 +2,6 @@
==================
This is maximum time in seconds a cache lock is valid to avoid dead
locks. The deafult value is 10 seconds.
locks. The default value is 10 seconds.
See also [`$cache_locking`](#variable.cache.locking)
@@ -1,21 +0,0 @@
\$php\_handling {#variable.php.handling}
===============
This tells Smarty how to handle PHP code embedded in the templates.
There are four possible settings, the default being
`Smarty::PHP_PASSTHRU`. Note that this does NOT affect php code within
[`{php}{/php}`](#language.function.php) tags in the template.
- `Smarty::PHP_PASSTHRU` - Smarty echos tags as-is.
- `Smarty::PHP_QUOTE` - Smarty quotes the tags as html entities.
- `Smarty::PHP_REMOVE` - Smarty removes the tags from the templates.
- `Smarty::PHP_ALLOW` - Smarty will execute the tags as PHP code.
> **Note**
>
> Embedding PHP code into templates is highly discouraged. Use [custom
> functions](#plugins.functions) or [modifiers](#plugins.modifiers)
> instead.
@@ -18,7 +18,7 @@ found.
>
> If the directories known to `$template_dir` are relative to
> directories known to the
> [include\_path](&url.php-manual;ini.core.php#ini.include-path) you
> [include\_path](https://www.php.net/ini.core.php#ini.include-path) you
> need to activate the [`$use_include_path`](#variable.use.include.path)
> option.
@@ -5,4 +5,4 @@
array of all directories that are considered trusted. Trusted
directories are where you keep php scripts that are executed directly
from the templates with
[`{include_php}`](#language.function.include.php).
[`{insert}`](#language.function.insert.php).
@@ -2,7 +2,7 @@
====================
This tells smarty to respect the
[include\_path](&url.php-manual;ini.core.php#ini.include-path) within
[include\_path](https://www.php.net/ini.core.php#ini.include-path) within
the [`File Template Resource`](#resources.file) handler and the plugin
loader to resolve the directories known to
[`$template_dir`](#variable.template.dir). The flag also makes the
@@ -23,14 +23,14 @@ If use\_include\_path is enabled, file discovery for
\$plugins\_dir) do
- Test if requested file is in `$directory` relative to the [current
working directory](&url.php-manual;function.getcwd.php). If file
working directory](https://www.php.net/function.getcwd.php). If file
found, return it.
- For each `$path` in include\_path do
- Test if requested file is in `$directory` relative to the `$path`
(possibly relative to the [current working
directory](&url.php-manual;function.getcwd.php)). If file found,
directory](https://www.php.net/function.getcwd.php)). If file found,
return it.
- Try default\_handler or fail.
@@ -10,7 +10,7 @@ environments do not allow PHP processes to create directories, so this
must be disabled which is the default.
Sub directories are more efficient, so use them if you can.
Theoretically you get much better perfomance on a filesystem with 10
Theoretically you get much better performance on a filesystem with 10
directories each having 100 files, than with 1 directory having 1000
files. This was certainly the case with Solaris 7 (UFS)\... with newer
filesystems such as ext3 and especially reiserfs, the difference is
@@ -19,7 +19,7 @@ almost nothing.
> **Note**
>
> - `$use_sub_dirs=true` doesn\'t work with
> [safe\_mode=On](&url.php-manual;features.safe-mode), that\'s why
> [safe\_mode=On](https://www.php.net/features.safe-mode), that\'s why
> it\'s switchable and why it\'s off by default.
>
> - `$use_sub_dirs=true` on Windows can cause problems.