From 92e05d4f8d51b4a9e2503296241981b9b78f4156 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Thu, 7 Jan 2021 00:26:28 +0100 Subject: [PATCH 1/5] Brought lexer source functionally up-to-date with compiled version (#625) Fixes #621 --- CHANGELOG.md | 1 + lexer/smarty_internal_templateparser.y | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27702e35..acdfc49a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - PHP5.3 compatibility fixes +- Brought lexer source functionally up-to-date with compiled version ## [3.1.36] - 2020-04-14 diff --git a/lexer/smarty_internal_templateparser.y b/lexer/smarty_internal_templateparser.y index b8c00e5d..c6890642 100644 --- a/lexer/smarty_internal_templateparser.y +++ b/lexer/smarty_internal_templateparser.y @@ -249,7 +249,13 @@ template ::= template PHP(B). { // template text template ::= template TEXT(B). { - $this->current_buffer->append_subtree($this, $this->compiler->processText(B)); + $text = $this->yystack[ $this->yyidx + 0 ]->minor; + + if ((string)$text == '') { + $this->current_buffer->append_subtree($this, null); + } + + $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Text($text, $this->strip)); } // strip on template ::= template STRIPON. { @@ -308,7 +314,7 @@ smartytag(A)::= SIMPLETAG(B). { $tag = trim(substr(B, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength())); if ($tag == 'strip') { $this->strip = true; - A = null;; + A = null; } else { if (defined($tag)) { if ($this->security) { From f65e7ddd22acde2f09da82cb64f8b51d414b75f0 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Thu, 7 Jan 2021 00:34:08 +0100 Subject: [PATCH 2/5] fixed changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index acdfc49a..081d306f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.1.37] - 2021-01-07 + ### Changed - Changed error handlers and handling of undefined constants for php8-compatibility (set $errcontext argument optional) https://github.com/smarty-php/smarty/issues/605 - Changed expected error levels in unit tests for php8-compatibility From cb4254355e399265af2503f2dfc5566967369c7f Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Fri, 8 Jan 2021 15:05:10 +0100 Subject: [PATCH 3/5] Removed unused error_reporting.ini file, updated version number in Smarty::SMARTY_VERSION, fixed inline phpdoc that caused an IDE error --- .gitattributes | 1 - CHANGELOG.md | 3 +++ error_reporting.ini | 1 - libs/Smarty.class.php | 3 +-- libs/sysplugins/smarty_internal_config_file_compiler.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 error_reporting.ini diff --git a/.gitattributes b/.gitattributes index f58d5806..2cda67b0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,7 +12,6 @@ /.gitattributes export-ignore /.gitignore export-ignore /.travis.yml export-ignore -/error_reporting.ini export-ignore /make-release.sh export-ignore /phpunit.sh export-ignore /phpunit.xml export-ignore diff --git a/CHANGELOG.md b/CHANGELOG.md index 081d306f..177dc7af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Smarty::SMARTY_VERSION wasn't updated https://github.com/smarty-php/smarty/issues/628 + ## [3.1.37] - 2021-01-07 ### Changed diff --git a/error_reporting.ini b/error_reporting.ini deleted file mode 100644 index 496bbf5c..00000000 --- a/error_reporting.ini +++ /dev/null @@ -1 +0,0 @@ -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT \ No newline at end of file diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 30a0a140..7b33d0f5 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -27,7 +27,6 @@ * @author Uwe Tews * @author Rodney Rehm * @package Smarty - * @version 3.1.36 */ /** * set SMARTY_DIR to absolute path to Smarty library files. @@ -112,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.36'; + const SMARTY_VERSION = '3.1.37'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_config_file_compiler.php b/libs/sysplugins/smarty_internal_config_file_compiler.php index a842fa8f..90c5dcef 100644 --- a/libs/sysplugins/smarty_internal_config_file_compiler.php +++ b/libs/sysplugins/smarty_internal_config_file_compiler.php @@ -115,7 +115,7 @@ class Smarty_Internal_Config_File_Compiler $this->smarty->_debug->start_compile($this->template); } // init the lexer/parser to compile the config file - /* @var Smarty_Internal_ConfigFileLexer $this ->lex */ + /* @var Smarty_Internal_ConfigFileLexer $this->lex */ $this->lex = new $this->lexer_class( str_replace( array( @@ -127,7 +127,7 @@ class Smarty_Internal_Config_File_Compiler ) . "\n", $this ); - /* @var Smarty_Internal_ConfigFileParser $this ->parser */ + /* @var Smarty_Internal_ConfigFileParser $this->parser */ $this->parser = new $this->parser_class($this->lex, $this); if (function_exists('mb_internal_encoding') && function_exists('ini_get') From 2af2a0790680cd2bb027757bd68798f882e076ee Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Fri, 8 Jan 2021 15:05:40 +0100 Subject: [PATCH 4/5] version bump --- CHANGELOG.md | 2 ++ libs/Smarty.class.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 177dc7af..06b89822 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.1.38] - 2021-01-08 + ### Fixed - Smarty::SMARTY_VERSION wasn't updated https://github.com/smarty-php/smarty/issues/628 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 7b33d0f5..6564be6d 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.37'; + const SMARTY_VERSION = '3.1.38'; /** * define variable scopes */ From 3af2df20a47fea090273b611cb4073cd63a975e5 Mon Sep 17 00:00:00 2001 From: Ikko Ashimine Date: Sat, 9 Jan 2021 01:28:33 +0900 Subject: [PATCH 5/5] Fix typo in StreamVariableTest.php (#616) existant -> existent --- .../ValueTests/Variables/Stream/StreamVariableTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php index 670324f1..aed4fb9b 100644 --- a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php +++ b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php @@ -59,7 +59,7 @@ class StreamVariableTest extends PHPUnit_Smarty } */ /** - * test no existant stream variable + * test no existent stream variable */ // public function testStreamVariable2() // {