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

Bug #9501 incorrect parsing of string literal with setVariable()
Submitted: 2006-11-29 17:27 UTC
From: aa1 at addihome dot org Assigned: dsp
Status: Closed Package: HTML_Template_IT (version 1.2.1)
PHP Version: 4.4.2 OS: linux
Roadmaps: 1.3.0a1    
Subscription  


 [2006-11-29 17:27 UTC] aa1 at addihome dot org (Arie Addi)
Description: ------------ setVariable does not parse a string with a $ symbol and one or more digits as a literal. Rather it swallows up the $ and up to two digits. Examples: Ex. 1: setVariable("AMNT", '$45.33'); output => .33 Ex. 2: $word = "Cost is \$" . '183.22'); setVariable("AMNT", $word); output => Cost is 3.22 Ex. 3: $word = 'Cost is $456.98'; setVariable("AMNT", $word); output => Cost is 6.98 to work around this bug I use. $word = addcslashes($word, '$'); or add a \ in single quotes before the $ as in \$.

Comments

 [2006-11-30 14:48 UTC] dsp at php dot net (David Soria Parra)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2006-11-30 22:06 UTC] dsp at php dot net (David Soria Parra)
As long as it's not released you might use the option $tpl->setOption("use_preg"=>false)