Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.2

Bug #50 dollar sign parse bug
Submitted: 2003-09-30 16:25 UTC
From: jinxidoru Assigned: pajoye
Status: Bogus Package: HTML_Template_IT
PHP Version: 4.3.1 OS: FreeBSD
Roadmaps: (Not assigned)    
Subscription  


 [2003-09-30 16:25 UTC] jinxidoru
Description: ------------ When a string containing a dollar sign followed by one or two integers is placed into a block variable, the dollar sign and integers are not displayed. They disappear. For example: $tpl->setVariable("var", "the amount was $20,000"); This displays "the amount was ,000". This is easily remedied though. It comes from the preg_replace statement in the file IT.php, function parse(). PHP is interpreting the $20 as a back-reference. So to fix this simply place a line right before the preg_replace reading: $values = str_replace('$','\\$',$values);

Comments

 [2003-12-15 08:18 UTC] pajoye
Thank you for taking the time to write to us, but this is not a bug. Hello, If you use reserved chars (regexp) in your assigned value you may use the following option: $tpl = new HTML_Template_IT('./',array('use_preg'=>true)); ... $tpl->setVariable('var','amount is $20000'); hth pierre
 [2004-12-01 04:45 UTC] msams992000 at yahoo dot com dot au
Should be 'use_preg'=>false