diff --git a/.gitattributes b/.gitattributes index 29df9130..4ba2fe45 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,7 +11,6 @@ /.gitattributes export-ignore /.gitignore 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 3b9989a8..89d76e56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ 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 + +## [3.1.37] - 2021-01-07 + ### Changed - Switch CI from Travis to Github CI - Updated unit tests to avoid skipped and risky test warnings @@ -26,6 +33,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/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/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) { diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 30a0a140..6564be6d 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.38'; /** * 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') diff --git a/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php b/tests/UnitTests/TemplateSource/ValueTests/Variables/Stream/StreamVariableTest.php index 09e31373..e49d6205 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() // {