<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged quotes</title>
<link>https://www.question2answer.org/qa/tag/quotes</link>
<description>Powered by Question2Answer</description>
<item>
<title>Is the Logic for get_magic_quotes_gpc backwards?</title>
<link>https://www.question2answer.org/qa/2613/is-the-logic-for-get_magic_quotes_gpc-backwards</link>
<description>I was having issues with words containing apostrophes like Bob's and quotes like &amp;quot;QUOTES&amp;quot;. &amp;nbsp;I was getting slashes like it was escaping and found the logic for magic quotes may be reversed.&lt;br /&gt;
&lt;br /&gt;
I have inverted the logic in qa-base.php and it seems to work, but this may be a bad solution. &amp;nbsp;Would someone please confirm.&lt;br /&gt;
&lt;br /&gt;
This works (extracted from qa-base.php):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; function qa_gpc_to_string($string)&lt;br /&gt;
/*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Return string for incoming GET/POST/COOKIE value, stripping slashes if appropriate&lt;br /&gt;
*/&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //return get_magic_quotes_gpc() ? stripslashes($string) : $string;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return get_magic_quotes_gpc() ? $string : stripslashes($string);&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; function qa_string_to_gpc($string)&lt;br /&gt;
/*&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Return string with slashes added, if appropriate for later removal by qa_gpc_to_string()&lt;br /&gt;
*/&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; //return get_magic_quotes_gpc() ? addslashes($string) : $string;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return get_magic_quotes_gpc() ? $string : addslashes($string);&lt;br /&gt;
}</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/2613/is-the-logic-for-get_magic_quotes_gpc-backwards</guid>
<pubDate>Fri, 10 Sep 2010 16:17:29 +0000</pubDate>
</item>
</channel>
</rss>