WordPress/wp-admin/network
Ryan Boren cc5ed3a485 Change all core API to expect unslashed rather than slashed arguments.
The exceptions to this are update_post_meta() and add_post_meta() which are often used by plugins in POST handlers and will continue accepting slashed data for now.

Introduce wp_upate_post_meta() and wp_add_post_meta() as unslashed alternatives to update_post_meta() and add_post_meta(). These functions could become methods in WP_Post so don't use them too heavily yet.

Remove all escape() calls from wp_xmlrpc_server. Now that core expects unslashed data this is no longer needed.

Remove addslashes(), addslashes_gpc(), add_magic_quotes() calls on data being prepared for handoff to core functions that until now expected slashed data. Adding slashes in no longer necessary.

Introduce wp_unslash() and use to it remove slashes from GPCS data before using it in core API. Almost every instance of stripslashes() in core should now be wp_unslash(). In the future (a release or three) when GPCS is no longer slashed, wp_unslash() will stop stripping slashes and simply return what is passed. At this point wp_unslash() calls can be removed from core.

Introduce wp_slash() for slashing GPCS data. This will also turn into a noop once GPCS is no longer slashed. wp_slash() should almost never be used. It is mainly of use in unit tests.

Plugins should use wp_unslash() on data being passed to core API.

Plugins should no longer slash data being passed to core. So when you get_post() and then wp_insert_post() the post data from get_post() no longer needs addslashes(). Most plugins were not bothering with this. They will magically start doing the right thing. Unfortunately, those few souls who did it properly will now have to avoid calling addslashes() for 3.6 and newer.

Use wp_kses_post() and wp_kses_data(), which expect unslashed data, instead of wp_filter_post_kses() and wp_filter_kses(), which expect slashed data. Filters are no longer passed slashed data.

Remove many no longer necessary calls to $wpdb->escape() and esc_sql().

In wp_get_referer() and wp_get_original_referer(), return unslashed data.

Remove old stripslashes() calls from WP_Widget::update() handlers. These haven't been necessary since WP_Widget.

Switch several queries over to prepare().

Expect something to break.

Props alexkingorg
see #21767


git-svn-id: http://core.svn.wordpress.org/trunk@23416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 22:51:06 +00:00
..
about.php about.php and friends for the global dashboard. see #19762. 2012-01-06 18:08:45 +00:00
admin.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
credits.php about.php and friends for the global dashboard. see #19762. 2012-01-06 18:08:45 +00:00
edit.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
freedoms.php about.php and friends for the global dashboard. see #19762. 2012-01-06 18:08:45 +00:00
index.php Use WP_Screen::add_help_tab(). see #19020 2011-12-01 02:22:07 +00:00
menu.php Correct a translation context in the network admin. props SergeyBiryukov. fixes #20910. 2012-09-15 19:57:46 +00:00
plugin-editor.php Network admin multisite checks and docs. see #14435. 2010-11-10 14:27:15 +00:00
plugin-install.php Set IFRAME_REQUEST for theme/plugin information iframe. Props SergeyBiryukov, fixes #15509 2010-12-01 18:53:37 +00:00
plugins.php Network admin multisite checks and docs. see #14435. 2010-11-10 14:27:15 +00:00
profile.php Network admin multisite checks and docs. see #14435. 2010-11-10 14:27:15 +00:00
settings.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
setup.php Move the network version of Tools > Network to the network admin. props wpdavis, fixes #15461. 2010-11-18 05:24:13 +00:00
site-info.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
site-new.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
site-settings.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
site-themes.php Remove unused edit-site nonce fields from site-users and site-themes. props jeremyfelt, fixes #21277. 2012-09-18 23:06:22 +00:00
site-users.php Remove unused edit-site nonce fields from site-users and site-themes. props jeremyfelt, fixes #21277. 2012-09-18 23:06:22 +00:00
sites.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
theme-editor.php Network admin multisite checks and docs. see #14435. 2010-11-10 14:27:15 +00:00
theme-install.php Set IFRAME_REQUEST for theme/plugin information iframe. Props SergeyBiryukov, fixes #15509 2010-12-01 18:53:37 +00:00
themes.php Fix Bulk Theme Deletion in the Network Admin when using FTP. Props kobenland. Fixes #20671 2012-09-29 01:36:14 +00:00
update-core.php Network admin multisite checks and docs. see #14435. 2010-11-10 14:27:15 +00:00
update.php IFRAME_REQUEST for network/update.php. props duck_, see #15724. 2010-12-10 18:25:18 +00:00
upgrade.php Deprecate get_blog_option(), add_blog_option(), update_blog_option(), and delete_blog_option(). 2012-08-03 17:51:42 +00:00
user-edit.php Network admin multisite checks and docs. see #14435. 2010-11-10 14:27:15 +00:00
user-new.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
users.php Hide the link manager from the UI on upgrade, if the site has no links. New DB option, link_manager_enabled. 2012-08-13 16:18:42 +00:00