|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-10-03 05:42 UTC] creator at sacura dot net
Description:
------------
Problem with some names of variables in templates files (PEAR/IT).
Reproduce code:
---------------
<?php
require('HTML/Template/IT.php');
$tsql = new HTML_Template_IT();
$tsql->loadTemplateFile("test.sql");
$tsql->setVariable('C2','1');
print "test=". $tsql->get();
?>
and template (test.sql)
{DUMMY}
'{C2}/'
{DUMMY}
Expected result:
----------------
Warning: Compilation failed: nothing to repeat at offset 3 in c:\php\pear\HTML\Template\IT.php on line 575
test= '/'
Actual result:
--------------
it should be this:
'1/'
I think so.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 19 23:00:01 2025 UTC |
does this patch (warning, will be crippled by the textarea) solve your problem? Index: HTML_Template_IT/IT.php =================================================================== RCS file: /repository/pear/HTML_Template_IT/IT.php,v retrieving revision 1.6 diff -u -u -r1.6 IT.php --- HTML_Template_IT/IT.php 12 Mar 2003 02:25:16 -0000 1.6 +++ HTML_Template_IT/IT.php 10 Oct 2003 11:48:59 -0000 @@ -555,7 +555,7 @@ } - if (!$flag_recursion && 0 != count($values)) { + if (!$flag_recursion && 0 != count($values) && 0 != count($regs)) { if ($this->_options['use_preg']) { $regs = array_map(array( &$this, '_addPregDelimiters'),