ranlt / smarty-php

Automatically exported from code.google.com/p/smarty-php
0 stars 0 forks source link

Smarty Comments with Custom Delimiters Cause Fata Error #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Set custom delimiters:
$smarty->left_delimiter = '{|';
$smarty->right_delimiter = '|}';

2. Add a Smarty comment to a template:
{|* This should be a comment *|}

3. Output is a blank page with a syntax error in template (Unexpected "* ")

What is the expected output?
There should be normal page output, with no output of the comment

What do you see instead?
A blank page with this error in the logs:
Uncaught  --> Smarty Compiler: Syntax error
Unexpected "* "
thrown in 
~/Smarty-3.1.15/libs/sysplugins/smarty_internal_templatecompilerbase.php on 
line 45

What version of the product are you using?
Smarty-3.1.15

On what operating system?
CentOS 6.4

Original issue reported on code.google.com by gzmarket...@gmail.com on 9 Dec 2013 at 11:48

GoogleCodeExporter commented 9 years ago
Sorry, false alarm.

This was caused by a missing quote in the previous Smarty tag:

{|include file="one.tpl|}
{|* include file="two.tpl" *|}

Fixing the first tag fixed the problem:
{|include file="one.tpl"|}

For some reason Smarty v2 just let it slide, but v3 had a fatal error (as it 
should).

Original comment by gzmarket...@gmail.com on 9 Dec 2013 at 11:58

GoogleCodeExporter commented 9 years ago

Original comment by Uwe.Tews@googlemail.com on 10 Dec 2013 at 7:50