Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.1.3, 4.2.0
-
None
Description
When i activate TemplateCompile in the site.ini.append.php the compiled PHP-files contains an error. After what i have gathered the issue seems to be as follows:
in /lib/eztemplate/classes/eztemplatecompiler.php::generatePHPCodeChildren there is a line that looks like this:
$php->addCodePiece( " \$tpl->warning( '" . eZTemplateDefFunction::DEF_FUNCTION_NAME . "', \"Variable $variableNameText is already defined.\" );\n" );
This line uses $variableNameText that is created at this line in the same funciton:
$variableNameText = $php->thisVariableText( $variableName, 0, 0, false );
$php->thisVariableText returns a value with doublequotes. So if a $variableName initially was `myVariableName` it returns `"myVariableName"`.
As you might understand, the generatePHPCodeChildren will fail as the quoting is wrong. In "human readable" version it results in a string like this in the compiled PHP-file:
$tpl->warning( 'def', "Variable "template" is already defined." );