[wp-hackers] Filter for '

Scott Kingsley Clark scott at skcdev.com
Fri Sep 2 13:40:11 UTC 2011


> I have deactivate the default-filters.php and check many other
> filters, but i dont find the filter for this topic. I will deactive
> the filter on the plugin-page for use my strings; is an sql query for
> send sql queries inside backen, only for devs. I have also list all
> active filters and actions, but i dont find the function, to do this.

I know this one was very confusing, had to poke around deep and I
found it a while back. Thing is, I assumed WP wasn't doing anything up
until I found this, I thought I was going crazy ;)

What you're looking for is line 529 of /wp-includes/load.php in a
function called 'wp_magic_quotes', which uses
'add_magic_quotes' (found in /wp-includes/functions.php at line 1521)
to loop through an array (deep) and addslashes($v) to the values
within.

It escapes $_GET, $_POST, $_COOKIE, $_SERVER, and then merges $_GET +
$_POST as $_REQUEST (in that order), there's no filters or actions in
the function, but it runs between the two actions called
'plugins_loaded' and 'sanitize_comment_cookies' in /wp-settings.php at
line 212.

If you *absolutely had to* remove it, you could hook into
'sanitize_comment_cookies' to stripslashes_deep($_var) on the global
arrays you're after.

Hope this info helps you!

-Scott



More information about the wp-hackers mailing list