Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Smarty php8.4 support #412

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions smarty5/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions smarty5/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"packages": [
{
"name": "smarty/smarty",
"version": "v5.2.0",
"version_normalized": "5.2.0.0",
"version": "v5.3.1",
"version_normalized": "5.3.1.0",
"source": {
"type": "git",
"url": "https://github.com/smarty-php/smarty.git",
"reference": "cdee97d3f1dff597be8583625adb42710da2c885"
"reference": "3cb35854326a94120cd415b81db28c53d95d0d5d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/smarty-php/smarty/zipball/cdee97d3f1dff597be8583625adb42710da2c885",
"reference": "cdee97d3f1dff597be8583625adb42710da2c885",
"url": "https://api.github.com/repos/smarty-php/smarty/zipball/3cb35854326a94120cd415b81db28c53d95d0d5d",
"reference": "3cb35854326a94120cd415b81db28c53d95d0d5d",
"shasum": ""
},
"require": {
Expand All @@ -23,7 +23,7 @@
"phpunit/phpunit": "^8.5 || ^7.5",
"smarty/smarty-lexer": "^4.0.2"
},
"time": "2024-05-28T21:45:16+00:00",
"time": "2024-06-16T19:51:13+00:00",
"type": "library",
"extra": {
"branch-alias": {
Expand Down Expand Up @@ -69,23 +69,23 @@
"support": {
"forum": "https://github.com/smarty-php/smarty/discussions",
"issues": "https://github.com/smarty-php/smarty/issues",
"source": "https://github.com/smarty-php/smarty/tree/v5.2.0"
"source": "https://github.com/smarty-php/smarty/tree/v5.3.1"
},
"install-path": "../smarty/smarty"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.29.0",
"version_normalized": "1.29.0.0",
"version": "v1.30.0",
"version_normalized": "1.30.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
"reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c",
"reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c",
"shasum": ""
},
"require": {
Expand All @@ -97,7 +97,7 @@
"suggest": {
"ext-mbstring": "For best performance"
},
"time": "2024-01-29T20:11:03+00:00",
"time": "2024-06-19T12:30:46+00:00",
"type": "library",
"extra": {
"thanks": {
Expand Down Expand Up @@ -138,7 +138,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0"
},
"funding": [
{
Expand Down
16 changes: 8 additions & 8 deletions smarty5/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'bfa3c101f9cdda54c10fa607846ea1bafe388fce',
'reference' => '3ff6798863d74e4dbb710295c6076dc750807404',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,25 +13,25 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'bfa3c101f9cdda54c10fa607846ea1bafe388fce',
'reference' => '3ff6798863d74e4dbb710295c6076dc750807404',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'smarty/smarty' => array(
'pretty_version' => 'v5.2.0',
'version' => '5.2.0.0',
'reference' => 'cdee97d3f1dff597be8583625adb42710da2c885',
'pretty_version' => 'v5.3.1',
'version' => '5.3.1.0',
'reference' => '3cb35854326a94120cd415b81db28c53d95d0d5d',
'type' => 'library',
'install_path' => __DIR__ . '/../smarty/smarty',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
'pretty_version' => 'v1.29.0',
'version' => '1.29.0.0',
'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec',
'pretty_version' => 'v1.30.0',
'version' => '1.30.0.0',
'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
Expand Down
13 changes: 11 additions & 2 deletions smarty5/vendor/smarty/smarty/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [5.3.1] - 2024-06-16
- Fixed error when using section with nocache [#1034](https://github.com/smarty-php/smarty/issues/1034)


## [5.3.0] - 2024-05-30
- Fix warning when calling hasVariable for an undefined variable [#977](https://github.com/smarty-php/smarty/issues/977)
- Added `$smarty->prependTemplateDir()` method [#1022](https://github.com/smarty-php/smarty/issues/1022)


## [5.2.0] - 2024-05-28
- Fixed a code injection vulnerability in extends-tag. This addresses CVE-2024-35226.
- Added `$smarty->setCacheModifiedCheck()` setter for cache_modified_check
Expand All @@ -22,16 +31,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Internal compiler classes always return a string (the internal has_code flag has been removed for simplicity) [#918](https://github.com/smarty-php/smarty/pull/918)
- Fix invalid classnames in Runtime code for foreach [#1000](https://github.com/smarty-php/smarty/issues/1000)

## [5.0.2] - 2024-03-28
- Fix Smarty::assign() not returning $this when called with an array as first parameter [#972](https://github.com/smarty-php/smarty/pull/972)

## [5.0.1] - 2024-03-27
- Fix error in Smarty\Smarty::compileAllTemplates() by including missing FilesystemIterator class [#966](https://github.com/smarty-php/smarty/issues/966)


## [5.0.0] - 2024-03-25
- Fixed that scoped variables would overwrite parent scope [#952](https://github.com/smarty-php/smarty/issues/952)
- Removed publicly accessible `$tpl->_var_stack` variable


### Fixed
- Too many shorthand attributes error when using a modifier as a function with more than 3 parameters in an expression [#949](https://github.com/smarty-php/smarty/issues/949)

Expand Down
23 changes: 13 additions & 10 deletions smarty5/vendor/smarty/smarty/docs/api/configuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,27 @@ Use `getTemplateDir()` to retrieve the configured paths.
<?php

// set a single directory where the config files are stored
$smarty->setTemplateDir('./config');
$smarty->setTemplateDir('./templates');

// set multiple directories where config files are stored
$smarty->setTemplateDir(['./config', './config_2', './config_3']);
// set multiple directories where templates are stored
$smarty->setTemplateDir(['./templates', './templates_2', './templates_3']);

// add directory where config files are stored to the current list of dirs
$smarty->addTemplateDir('./config_1');
// add directory where templates files are stored to the current list of dirs
$smarty->addTemplateDir('./templates_1');

// add multiple directories to the current list of dirs
$smarty->addTemplateDir([
'./config_2',
'./config_3',
'./templates_2',
'./templates_3',
]);

// chaining of method calls
$smarty->setTemplateDir('./config')
->addTemplateDir('./config_1')
->addTemplateDir('./config_2');
$smarty->setTemplateDir('./templates')
->addTemplateDir('./templates_1')
->addTemplateDir('./templates_2');

// insert a template dir before exising template dirs
$smarty->prependTemplateDir('./more_important_templates')

// get all directories where config files are stored
$template_dirs = $smarty->getTemplateDir();
Expand Down
22 changes: 22 additions & 0 deletions smarty5/vendor/smarty/smarty/docs/img/smarty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ $COMPOSE_CMD run --rm php80 ./run-tests.sh $@ && \
$COMPOSE_CMD run --rm php81 ./run-tests.sh $@ && \
$COMPOSE_CMD run --rm php82 ./run-tests.sh $@
$COMPOSE_CMD run --rm php83 ./run-tests.sh $@
$COMPOSE_CMD run --rm php84 ./run-tests.sh $@
2 changes: 1 addition & 1 deletion smarty5/vendor/smarty/smarty/src/Cacheresource/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract public function populateTimestamp(Cached $cached);
*/
abstract public function process(
Template $_template,
Cached $cached = null,
?Cached $cached = null,
$update = false
);

Expand Down
2 changes: 1 addition & 1 deletion smarty5/vendor/smarty/smarty/src/Cacheresource/Custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function populateTimestamp(\Smarty\Template\Cached $cached)
*/
public function process(
Template $_smarty_tpl,
\Smarty\Template\Cached $cached = null,
?\Smarty\Template\Cached $cached = null,
$update = false
) {
if (!$cached) {
Expand Down
2 changes: 1 addition & 1 deletion smarty5/vendor/smarty/smarty/src/Cacheresource/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function populateTimestamp(Cached $cached)
*/
public function process(
Template $_smarty_tpl,
Cached $cached = null,
?Cached $cached = null,
$update = false
) {
$_smarty_tpl->getCached()->setValid(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function populateTimestamp(Cached $cached)
*/
public function process(
Template $_smarty_tpl,
Cached $cached = null,
?Cached $cached = null,
$update = false
) {
if (!$cached) {
Expand Down
2 changes: 1 addition & 1 deletion smarty5/vendor/smarty/smarty/src/Compile/Tag/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter =

if ($compiler->tag_nocache) {
// push a {nocache} tag onto the stack to prevent caching of this block
$this->openTag('nocache');
$this->openTag($compiler, 'nocache');
}

$this->openTag($compiler, 'section', ['section', $compiler->tag_nocache]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter =

if ($nocache_pushed) {
// pop the pushed virtual nocache tag
$this->closeTag('nocache');
$this->closeTag($compiler, 'nocache');
}

$output = "<?php\n";
Expand Down
2 changes: 1 addition & 1 deletion smarty5/vendor/smarty/smarty/src/Compiler/CodeFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function create(
$content = '',
$functions = '',
$cache = false,
\Smarty\Compiler\Template $compiler = null
?\Smarty\Compiler\Template $compiler = null
) {
// build property code
$properties[ 'version' ] = \Smarty\Smarty::SMARTY_VERSION;
Expand Down
2 changes: 1 addition & 1 deletion smarty5/vendor/smarty/smarty/src/Compiler/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public function compileTemplate(\Smarty\Template $template) {
* @throws CompilerException
* @throws Exception
*/
public function compileTemplateSource(\Smarty\Template $template, \Smarty\Compiler\Template $parent_compiler = null) {
public function compileTemplateSource(\Smarty\Template $template, ?\Smarty\Compiler\Template $parent_compiler = null) {
try {
// save template object in compiler class
$this->template = $template;
Expand Down
4 changes: 2 additions & 2 deletions smarty5/vendor/smarty/smarty/src/CompilerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ class CompilerException extends Exception {
* @param int $code The Exception code.
* @param string|null $filename The filename where the exception is thrown.
* @param int|null $line The line number where the exception is thrown.
* @param Throwable|null $previous The previous exception used for the exception chaining.
* @param \Throwable|null $previous The previous exception used for the exception chaining.
*/
public function __construct(
string $message = "",
int $code = 0,
?string $filename = null,
?int $line = null,
Throwable $previous = null
?\Throwable $previous = null
) {
parent::__construct($message, $code, $previous);

Expand Down
2 changes: 1 addition & 1 deletion smarty5/vendor/smarty/smarty/src/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function setVariable($varName, Variable $variableObject) {
* @return bool
*/
public function hasVariable($varName): bool {
return !($this->getVariable($varName) instanceof UndefinedVariable);
return !($this->getVariable($varName, true, false) instanceof UndefinedVariable);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion smarty5/vendor/smarty/smarty/src/Resource/BasePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ abstract public function getContent(Source $source);
* @param Source $source source object
* @param Template|null $_template template object
*/
abstract public function populate(Source $source, \Smarty\Template $_template = null);
abstract public function populate(Source $source, ?\Smarty\Template $_template = null);

/**
* populate Source Object with timestamp and exists from Resource
Expand Down
Loading