|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20199 HTML_Template_IT Logic Error
Submitted: 2002-10-31 13:46 UTC Modified: 2002-11-15 19:06 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: adam at tux dot appstate dot edu Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.2.3 OS: Red Hat 8.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: adam at tux dot appstate dot edu
New email:
PHP Version: OS:


 [2002-10-31 13:46 UTC] adam at tux dot appstate dot edu
When assigning a string that contains a "replacement variable"-like sub-string to an actual replacement variable, on IT's next "pass" it will replace the variable-like sub-string with nothing and if this string was contained within a block it will remove the block:

Lets assume for some unknown reason the programmer wishes to print name like this -> {name}



$vars["title"] = "Welcome! {Adam}";
$vars["content"] = "This is some content!";

$template = "
<!-- BEGIN TITLE -->
{title}<br />
<!-- END TITLE -->
{content}<br />
<!-- END CONTENT -->";

$tpl = new HTML_Template_IT;
$tpl->setTemplate($template, TRUE, TRUE);

echo $tpl->get();


When the above template and data is processed by IT it will not print the name contained in the string $vars["title"].

I hope this is enough info to figure out what's up :)



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-15 19:06 UTC]
This is normal. Try this:

$tpl = new HTML_Template_IT();
$tpl->setTemplate($template, TRUE, TRUE);
$tpl->removeUnknownVariables = false;

thanks for the report


PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 10 07:04:06 2022 UTC