Backslashes are removed when displaying data
Issue #127
duplicate
Originally reported on Google Code with ID 127
What steps will reproduce the problem?
1. Open a database table with some fields that contain backslashes (\)
2. The fields display with the backslashes removed
3. I have verified they exist in the database
What is the expected output? What do you see instead?
Expect to see backslashes, instead saw them removed
What version of the product are you using? On what operating system?
v1.9.2
Please provide any additional information below.
I fixed the problem myself by modifying the following
Replace:
public function formatString($value)
{
return htmlspecialchars(stripslashes($value));
}
With:
public function formatString($value)
{
return htmlspecialchars($value);
}
However I'm not sure if there's another use case that requires the stripslashes to
be used in this function.
Reported by m.holmes@aerocare.com.au
on 2012-11-01 00:56:39
Comments (2)
-
Account Deleted -
Thanks a lot for your bug report and the fix. The same issue has already been posted as issue #114. (With another usage example.) Your fix seems to be correct as well. I guess this stripslashes() might have been introduced to fix a problem caused by Magic Quotes. But as Magic Quotes is deprecated (dropped completely in PHP 5.4) and mostly disabled anyway, this causes more problems than it fixes. I think as mentioned in #114, I will drop the whole formatString() method and use my new htmlencode() function everywhere instead.
Reported by
crazy4chrissi
on 2012-11-01 11:50:32 - Status changed:Duplicate
- Merged into:#114 - Log in to comment
Reported by
m.holmes@aerocare.com.au
on 2012-11-01 00:58:36