- bugfix some custom left and right delimiters like '{^' '^}' did not work

https://github.com/smarty-php/smarty/issues/450 https://github.com/smarty-php/smarty/pull/482
This commit is contained in:
uwetews
2018-08-31 17:32:44 +02:00
parent 7b64226e16
commit 2c60503dfc
3 changed files with 7 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
===== 3.1.33-dev-10 =====
31.08.2018
- bugfix some custom left and right delimiters like '{^' '^}' did not work
https://github.com/smarty-php/smarty/issues/450 https://github.com/smarty-php/smarty/pull/482
- reformating for PSR-2 coding standards https://github.com/smarty-php/smarty/pull/483
- bugfix on Windows absolute filepathes did fail if the drive letter was followed by a linux DIRECTORY_SEPARATOR

View File

@@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.33-dev-10';
const SMARTY_VERSION = '3.1.33-dev-11';
/**
* define variable scopes
*/

View File

@@ -1212,20 +1212,20 @@ abstract class Smarty_Internal_TemplateCompilerBase
$this->ldelLength = strlen($ldel);
$this->ldelPreg = '';
foreach (str_split($ldel, 1) as $chr) {
$this->ldelPreg .= '[' . ($chr === '\\' ? '\\' : '') . $chr . ']';
$this->ldelPreg .= '[' . preg_quote($chr,'/') . ']';
}
$rdel = $this->smarty->getRightDelimiter();
$this->rdelLength = strlen($rdel);
$this->rdelPreg = '';
foreach (str_split($rdel, 1) as $chr) {
$this->rdelPreg .= '[' . ($chr === '\\' ? '\\' : '') . $chr . ']';
$this->rdelPreg .= '[' . preg_quote($chr,'/') . ']';
}
$literals = $this->smarty->getLiterals();
if (!empty($literals)) {
foreach ($literals as $key => $literal) {
$literalPreg = '';
foreach (str_split($literal, 1) as $chr) {
$literalPreg .= '[' . ($chr === '\\' ? '\\' : '') . $chr . ']';
$literalPreg .= '[' . preg_quote($chr,'/') . ']';
}
$literals[ $key ] = $literalPreg;
}