mirror of
https://github.com/smarty-php/smarty.git
synced 2026-08-10 15:31:28 +02:00
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fedc127057 | ||
|
|
3af2df20a4 | ||
|
|
63b3c0aed0 | ||
|
|
2af2a07906 | ||
|
|
cb4254355e | ||
|
|
f65e7ddd22 | ||
|
|
92e05d4f8d | ||
|
|
e2b28167f8 | ||
|
|
820782cd80 | ||
|
|
c295786e43 | ||
|
|
859a09e1bb | ||
|
|
a5934a755d |
@@ -12,7 +12,6 @@
|
|||||||
/.gitattributes export-ignore
|
/.gitattributes export-ignore
|
||||||
/.gitignore export-ignore
|
/.gitignore export-ignore
|
||||||
/.travis.yml export-ignore
|
/.travis.yml export-ignore
|
||||||
/error_reporting.ini export-ignore
|
|
||||||
/make-release.sh export-ignore
|
/make-release.sh export-ignore
|
||||||
/phpunit.sh export-ignore
|
/phpunit.sh export-ignore
|
||||||
/phpunit.xml export-ignore
|
/phpunit.xml export-ignore
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [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
|
### 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 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
|
- Changed expected error levels in unit tests for php8-compatibility
|
||||||
@@ -14,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- PHP5.3 compatibility fixes
|
- PHP5.3 compatibility fixes
|
||||||
|
- Brought lexer source functionally up-to-date with compiled version
|
||||||
|
|
||||||
## [3.1.36] - 2020-04-14
|
## [3.1.36] - 2020-04-14
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Smarty: the PHP compiling template engine
|
|||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
version 3.0 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
This library is distributed in the hope that it will be useful,
|
This library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
|
|
||||||
@@ -249,7 +249,13 @@ template ::= template PHP(B). {
|
|||||||
|
|
||||||
// template text
|
// template text
|
||||||
template ::= template TEXT(B). {
|
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
|
// strip on
|
||||||
template ::= template STRIPON. {
|
template ::= template STRIPON. {
|
||||||
@@ -308,7 +314,7 @@ smartytag(A)::= SIMPLETAG(B). {
|
|||||||
$tag = trim(substr(B, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()));
|
$tag = trim(substr(B, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()));
|
||||||
if ($tag == 'strip') {
|
if ($tag == 'strip') {
|
||||||
$this->strip = true;
|
$this->strip = true;
|
||||||
A = null;;
|
A = null;
|
||||||
} else {
|
} else {
|
||||||
if (defined($tag)) {
|
if (defined($tag)) {
|
||||||
if ($this->security) {
|
if ($this->security) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
* version 3.0 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@@ -27,7 +27,6 @@
|
|||||||
* @author Uwe Tews <uwe dot tews at gmail dot com>
|
* @author Uwe Tews <uwe dot tews at gmail dot com>
|
||||||
* @author Rodney Rehm
|
* @author Rodney Rehm
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @version 3.1.34-dev
|
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* set SMARTY_DIR to absolute path to Smarty library files.
|
* set SMARTY_DIR to absolute path to Smarty library files.
|
||||||
@@ -112,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.36';
|
const SMARTY_VERSION = '3.1.38';
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
* version 3.0 of the License, or (at your option) any later version.
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
|||||||
@@ -94,9 +94,9 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (strpos($_index[ 1 ], '$') === false && strpos($_index[ 1 ], '\'') === false) {
|
if (strpos($_index[ 1 ], '$') === false && strpos($_index[ 1 ], '\'') === false) {
|
||||||
return "defined('{$_index[1]}') ? constant('{$_index[1]}') : null";
|
return "(defined('{$_index[1]}') ? constant('{$_index[1]}') : null)";
|
||||||
} else {
|
} else {
|
||||||
return "defined({$_index[1]}) ? constant({$_index[1]}) : null";
|
return "(defined({$_index[1]}) ? constant({$_index[1]}) : null)";
|
||||||
}
|
}
|
||||||
// no break
|
// no break
|
||||||
case 'config':
|
case 'config':
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class Smarty_Internal_Config_File_Compiler
|
|||||||
$this->smarty->_debug->start_compile($this->template);
|
$this->smarty->_debug->start_compile($this->template);
|
||||||
}
|
}
|
||||||
// init the lexer/parser to compile the config file
|
// 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(
|
$this->lex = new $this->lexer_class(
|
||||||
str_replace(
|
str_replace(
|
||||||
array(
|
array(
|
||||||
@@ -127,7 +127,7 @@ class Smarty_Internal_Config_File_Compiler
|
|||||||
) . "\n",
|
) . "\n",
|
||||||
$this
|
$this
|
||||||
);
|
);
|
||||||
/* @var Smarty_Internal_ConfigFileParser $this ->parser */
|
/* @var Smarty_Internal_ConfigFileParser $this->parser */
|
||||||
$this->parser = new $this->parser_class($this->lex, $this);
|
$this->parser = new $this->parser_class($this->lex, $this);
|
||||||
if (function_exists('mb_internal_encoding')
|
if (function_exists('mb_internal_encoding')
|
||||||
&& function_exists('ini_get')
|
&& function_exists('ini_get')
|
||||||
|
|||||||
@@ -339,6 +339,10 @@ class CacheResourceTestCommon extends PHPUnit_Smarty
|
|||||||
$this->assertNull($tpl->cached->handler->getCachedContent($tpl3));
|
$this->assertNull($tpl->cached->handler->getCachedContent($tpl3));
|
||||||
$this->assertEquals('hello world', $tpl->cached->handler->getCachedContent($tpl4));
|
$this->assertEquals('hello world', $tpl->cached->handler->getCachedContent($tpl4));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group slow
|
||||||
|
*/
|
||||||
public function testClearCacheExpired()
|
public function testClearCacheExpired()
|
||||||
{
|
{
|
||||||
$this->smarty->caching = true;
|
$this->smarty->caching = true;
|
||||||
@@ -399,7 +403,7 @@ class CacheResourceTestCommon extends PHPUnit_Smarty
|
|||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
* @dataProvider data
|
* @dataProvider data
|
||||||
*
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testCache($lockTime, $lockTimeout, $compile_id, $cache_id, $isCached, $tmin, $tmax, $forceCompile, $forceCache, $update, $testNumber, $compileTestNumber, $renderTestNumber, $testName)
|
public function testCache($lockTime, $lockTimeout, $compile_id, $cache_id, $isCached, $tmin, $tmax, $forceCompile, $forceCache, $update, $testNumber, $compileTestNumber, $renderTestNumber, $testName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty
|
|||||||
* test grandchild/child/parent dependency test2
|
* test grandchild/child/parent dependency test2
|
||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
*
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testCompileBlockGrandChildMustCompile_021_2()
|
public function testCompileBlockGrandChildMustCompile_021_2()
|
||||||
{
|
{
|
||||||
@@ -193,7 +193,7 @@ class ExtendsResourceTest extends PHPUnit_Smarty
|
|||||||
* test grandchild/child/parent dependency test4
|
* test grandchild/child/parent dependency test4
|
||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
*
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testCompileBlockGrandChildMustCompile_021_4()
|
public function testCompileBlockGrandChildMustCompile_021_4()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -610,7 +610,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
|||||||
*
|
*
|
||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
*
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testCompileBlockGrandChildMustCompile_021_2()
|
public function testCompileBlockGrandChildMustCompile_021_2()
|
||||||
{
|
{
|
||||||
@@ -645,7 +645,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
|||||||
*
|
*
|
||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
*
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testCompileBlockGrandChildMustCompile_021_3()
|
public function testCompileBlockGrandChildMustCompile_021_3()
|
||||||
{
|
{
|
||||||
@@ -670,7 +670,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
|||||||
*
|
*
|
||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
*
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testCompileBlockGrandChildMustCompile_021_32()
|
public function testCompileBlockGrandChildMustCompile_021_32()
|
||||||
{
|
{
|
||||||
@@ -692,6 +692,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
|||||||
*
|
*
|
||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testCompileBlockGrandChildMustCompile_021_4()
|
public function testCompileBlockGrandChildMustCompile_021_4()
|
||||||
{
|
{
|
||||||
@@ -716,6 +717,7 @@ class CompileBlockExtendsTest extends PHPUnit_Smarty
|
|||||||
*
|
*
|
||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testCompileBlockGrandChildMustCompile_021_42()
|
public function testCompileBlockGrandChildMustCompile_021_42()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -210,6 +210,7 @@ class CompileInsertTest extends PHPUnit_Smarty
|
|||||||
* test insert plugin caching 2
|
* test insert plugin caching 2
|
||||||
* @runInSeparateProcess
|
* @runInSeparateProcess
|
||||||
* @preserveGlobalState disabled
|
* @preserveGlobalState disabled
|
||||||
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testInsertPluginCaching3_2()
|
public function testInsertPluginCaching3_2()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class SmartyNowTest extends PHPUnit_Smarty
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* test {$smarty.now nocache}
|
* test {$smarty.now nocache}
|
||||||
*
|
* @group slow
|
||||||
*/
|
*/
|
||||||
public function testSmartyNowNocache() {
|
public function testSmartyNowNocache() {
|
||||||
$this->smarty->setCaching(true);
|
$this->smarty->setCaching(true);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class StreamVariableTest extends PHPUnit_Smarty
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* test no existant stream variable
|
* test no existent stream variable
|
||||||
*/
|
*/
|
||||||
// public function testStreamVariable2()
|
// public function testStreamVariable2()
|
||||||
// {
|
// {
|
||||||
|
|||||||
Reference in New Issue
Block a user