Home » HTML » HTML_Template_IT » Bug #10101
Unknown Variables are not always removed
Details
| Submitted | 2007-02-14 17:30 UTC |
|---|---|
| From | tles dot kin201_pear at gadz dot org |
| Assigned | dsp |
| Status | Closed |
| Package | HTML_Template_IT |
| PHP Version | Irrelevant |
| OS | Linux |
| Roadmaps | 1.3.0a1 |
Comments
[2007-02-14 17:30 UTC] tles dot kin201_pear at gadz dot org
Description:
------------
When no variable is set in the __global__ block and some variables are set in a child block of __global__, unknown variables are not removed if you parse the child block
Just my 2 cents
Christophe Colombier
A french guy
Test script:
---------------
<?php
header("Content-Type: text/plain; charset=UTF-8");
require("HTML/Template/ITX.php");
$template = <<<HTML
Unused : {UNUSED}
Block: <!-- BEGIN foo -->{VAR}<!-- END foo -->
HTML;
// with parse
$tpl = new HTML_Template_ITX;
$tpl->setTemplate($template);
$tpl->setVariable("VAR" , "ok");
$tpl->parse("foo");
$tpl->show();
// without parse
$tpl = new HTML_Template_ITX;
$tpl->setTemplate($template);
$tpl->setVariable("VAR" , "ok");
$tpl->show();
?>
Expected result:
----------------
Unused :
Block: ok
Unused :
Block: ok
Actual result:
--------------
Unused : {UNUSED}
Block: ok
Unused :
Block: ok
[2007-02-14 17:38 UTC] dsp at php dot net
Thank you for taking the time to report a problem with the package.
This problem may have been already fixed by a previous change that
is in the CVS of the package. Please log into CVS with:
cvs -d :pserver:cvsread@cvs.php.net:/repository login
and check out the CVS repository of this package and upgrade
cvs -d :pserver:cvsread@cvs.php.net:/repository co pear/HTML_Template_IT
pear upgrade pear/HTML_Template_IT/package2.xml
or
pear upgrade pear/HTML_Template_IT/package.xml
If you are able to reproduce the bug with the latest CVS,
please change the status back to "Open".
Again, thank you for your continued support of PEAR.
[2007-02-15 00:10 UTC] tles dot kin201_pear at gadzarts dot org
Indeed, the bug is fixed in the cvs.
Sorry for reporting this the bug :)
Thanks a lot,
Christophe Colombier
[2007-02-15 00:15 UTC] tles dot kin201_pear at gadz dot org
The "bug" doesn't occur with the latest CVS,