[wp-hackers] Filter for '

Braydon ronin at braydon.com
Fri Sep 2 10:21:47 UTC 2011

On 09/02/2011 03:08 AM, Frank Bueltge wrote:
> Hello at all,
> i have an plugin, he send via _POST data from textarea, the textarea
> and all is inside a thickbox of WP. If i send the data with ', the i
> get an \' and also it is with \'post_tag\' to \\\'post_tag\\\'.
You can use the PHP function stripslashes ( 
http://php.net/manual/en/function.stripslashes.php ) to remove them.

WordPress has one also, stripslashes_deep ( 
) to go through arrays and strings.

I believe this happens when magic_quotes_gpc is enabled ( 
) So you could also disable this behavior if it's unwanted ( 
http://www.php.net/manual/en/security.magicquotes.disabling.php ).

More information about the wp-hackers mailing list