Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on use custom smarty delimiters #264

Closed
a-shpota opened this issue Aug 4, 2016 · 1 comment
Closed

Error on use custom smarty delimiters #264

a-shpota opened this issue Aug 4, 2016 · 1 comment

Comments

@a-shpota
Copy link
Contributor

a-shpota commented Aug 4, 2016

I get error when using /*{ and }*/ as delimiters;

$smarty = new Smarty();
$smarty -> setLeftDelimiter('/*{');
$smarty -> setRightDelimiter('}*/');
$smarty -> setTemplateDir('.');
echo $smarty -> fetch('test.tpl');

test.tpl

/*{$variable = 'value'}*/
/*{$variable}*/

result

PHP Warning:  preg_match(): Unknown modifier ')' in .../vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatelexer.php on line 577

This is because used delimiters '/' instead '' in regular expressions
but escaped '
'

smarty/libs/sysplugins/smarty_internal_templatelexer.php:212

`preg_quote($this->smarty->left_delimiter, '~')`

Thanks!

@uwetews
Copy link
Contributor

uwetews commented Aug 4, 2016

The fix is now in the master branch

@uwetews uwetews closed this as completed Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants