|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21951 IT.php (HTML_Template_IT)
Submitted: 2003-01-29 14:29 UTC Modified: 2003-02-11 13:26 UTC
From: wima at tiscalinet dot ch Assigned: pajoye (profile)
Status: Not a bug Package: PEAR related
PHP Version: 4.2.3 OS: Windows, Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: wima at tiscalinet dot ch
New email:
PHP Version: OS:


 [2003-01-29 14:29 UTC] wima at tiscalinet dot ch
I have a variable with the string =$A3*B$2
I add this to my Template with setVariable().
Then I parse the Template with parse().
And then I display it with show().

The string shows as =$A3*B
Where is the $2?

I fixed this Bug in the parse-function:
line 462: $values[] = addcslashes($this->variableCache[$allowedvar],'$');

I think, this Bug is in line 452 too:
$values[] = addcslashes($value,'$');

Can anyone fix this in the repository?
Thank you very much!



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-30 00:26 UTC] wima at tiscalinet dot ch
There is another bug:
$tpl = new HTML_Template_IT(_TEMPLATE_DIR);
	"ANTWORT" => 'aa{bb}cc'

displays aacc. Where is the {bb}?
 [2003-01-30 05:50 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


Both are normal behiavors. For you 2nd problem, try this:

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

The 1st problem can be solved using the addcslashed()before assigning values. That may be added to the documentation as a link to the preg pattern replacement rules, I'll do it later.

Thank's for your report, 

 [2003-01-30 06:16 UTC] wima at tiscalinet dot ch
But I have Unknown Variables and I want remove them :-(
 [2003-02-11 13:26 UTC]
I am wondering if using str_replace instead of preg_replace 
would solve these two problems... Could you please test it 
? Thanks.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 08 11:01:26 2023 UTC