Home » HTML » HTML_Template_Sigma » Bug #1840
stripslashes needed in _buildFunctionlist()
Details
| 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) |
Comments
[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.