aaroneiche / do-want

Do Want - Open Source Gift Registry
18 stars 4 forks source link

quotation marks in item description show up with slashes #58

Closed aaroneiche closed 11 years ago

aaroneiche commented 11 years ago

Original author: ke...@envail.com (December 04, 2012 15:30:33)

Item descriptions with quotation marks show up with slashes preceding them.

E.g. "Title of Book" by John Doe becomes "Title of Book" by John Doe

Original issue: http://code.google.com/p/do-want/issues/detail?id=58

aaroneiche commented 11 years ago

From ke...@envail.com on December 04, 2012 15:35:30 Actually, this is true for single quotes, too; I just didn't realize it. Existing ones look fine, but once you edit and save the item, it adds the slashes, and adds more and more slashes each time.

So, 'Title of Book' becomes \'Title of Book\'

The same is true for item comments, so if you put this in the comments:

I can't live with this item! becomes I can\'t live without this item!

And each successive safe progressively makes it worse, adding an additional slash each time. After a few edits, you end up with:

\\"Title of Book\\" by Author Name

I can\\'t live without this item!

aaroneiche commented 11 years ago

From aaron.ei...@gmail.com on December 20, 2012 01:25:23 After some investigate into this issue, it appears that this is related to a PHP configuration "Magic Quotes". Magic quotes is a method of data processing to escape data automatically on incoming input values. In PHP 5.3, Magic Quotes has been deprecated and will be removed in 5.4

For versions prior to 5.3, users should either turn off magic quotes in their PHP.ini file with the following line:

magic_quotes_gpc = Off

or with the following line in their .htaccess file in the do-want directory (this may not work with some hosts):

php_flag magic_quotes_gpc off

You may need to check with your hosting provider to determine the best means of disabling Magic Quotes. Future distributions of Do Want will include notices that Magic Quotes needs to be disabled.