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

Bug #1840 stripslashes needed in _buildFunctionlist()
Submitted: 2004-07-11 02:25 UTC
From: spam at nickm dot org Assigned: avb
Status: Closed Package: HTML_Template_Sigma
PHP Version: 4.3.7 OS: FreeBSD
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 11 + 34 = ?

 
 [2004-07-11 02:25 UTC] spam at nickm dot org
Description: ------------ The _getToken function deals properly with escaped quotes inside of quoted strings when dealling with callback functions. It retrieves everything until it meets an unquoted quote matching the beginning quote or the end of line. The only problem is that when the string is displayed, it still prints the backslash. This is likely the intended behavior if the atrribute was given without quotes, since it allows you to write backslashes without having to worry about escaping them. But when you've quoted the attribute, escaping any quotes inside is necessary, but not desired when printed. Reproduce code: --------------- func_callback ('Nixon\'s cool.') This can be fixed by adding the stripslashes by replacing this line inside _buildFunctionlist(): $funcData['args'][] = ('"' == $arg2{0} || "'" == $arg2{0}) ? substr($arg2, 1, -1) : $arg2; with: $funcData['args'][] = ('"' == $arg2{0} || "'" == $arg2{0}) ? stripslashes(substr($arg2, 1, -1)) : $arg2; Expected result: ---------------- Nixon's cool. Actual result: -------------- Nixon\'s cool.

Comments

 [2004-07-11 22:14 UTC] gurugeek
Dear Maintainer, Your package html_template_sigma has currently 1 open bug. We urge you to take the necessary steps to solve the reported issues at your soonest convenience. If the bug issue hasn’t been addressed yet you are kindly asked to take the necessary steps to ensure a prompt resolution of the problem. If you already addressed the reported problem feel free to change the bug status as soon as possible. Regards David Costa PEAR Quality Assurance pear-qa@lists.php.net
 [2004-08-10 15:54 UTC] avb
The bug is indeed there (I hit it myself), but unfortunately the fix should be a bit more complex than a simple stripslashes call.
 [2004-10-20 11:04 UTC] avb
Fixed in release 1.1.2 The escaped characters within the quoted string are now properly unescaped. Will document the rules for quoting the arguments soon.