Skip to content

Commit

Permalink
Merge pull request #411 from eileenmcnaughton/smarty5
Browse files Browse the repository at this point in the history
Update Smarty5 to latest released version
  • Loading branch information
demeritcowboy authored Aug 6, 2024
2 parents 3ff6798 + f5a36f9 commit 6a29d24
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 64 deletions.
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.
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/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
17 changes: 16 additions & 1 deletion smarty5/vendor/smarty/smarty/src/Smarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Smarty extends \Smarty\TemplateBase {
/**
* smarty version
*/
const SMARTY_VERSION = '5.2.0';
const SMARTY_VERSION = '5.3.1';

/**
* define caching modes
Expand Down Expand Up @@ -684,6 +684,21 @@ public function setTemplateDir($template_dir, $isConfig = false) {
return $this;
}

/**
* Adds a template directory before any existing directoires
*
* @param string $new_template_dir directory of template sources
* @param bool $is_config true for config_dir
*
* @return static current Smarty instance for chaining
*/
public function prependTemplateDir($new_template_dir, $is_config = false) {
$current_template_dirs = $is_config ? $this->config_dir : $this->template_dir;
array_unshift($current_template_dirs, $new_template_dir);
$this->setTemplateDir($current_template_dirs, $is_config);
return $this;
}

/**
* Add config directory(s)
*
Expand Down
Loading

0 comments on commit 6a29d24

Please sign in to comment.