WordPress/wp-admin
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
..
css Restore the following: 2013-02-13 23:50:55 +00:00
images Posts screen: show when a post is "locked", hide the checkbox, Quick Edit and Trash links, props dh-shredder, see #23312 2013-02-02 01:31:06 +00:00
includes Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
js Compress scripts/styles: 3.6-alpha-23400. 2013-02-08 22:58:42 +00:00
maint Use correct escaping function. fixes #23334. 2013-02-14 05:52:23 +00:00
network Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
user
about.php Remove 'Insert Multiple Images' from the about page as it is now completely invisible in the UI. Requiring shift-click but not mentioning it is a bad omen. props helenyhou. fixes #22455. 2012-12-07 20:58:34 +00:00
admin-ajax.php Heartbeat API: first run, see #23216 2013-01-29 06:15:25 +00:00
admin-footer.php Rename div#footer to div#wpfooter in the admin. Namespace one of our major elements and avoid clashing with widgets with the id of 'footer'. props andrewryno, koopersmith. see #14466. 2012-09-16 23:03:35 +00:00
admin-functions.php
admin-header.php Move utils.js (cookie and user setting functions) to wp-includes to enable front-end use. 2012-12-04 19:29:56 +00:00
admin-post.php
admin.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
async-upload.php Verify attachment parent during upload. 2012-11-29 02:39:34 +00:00
comment.php
credits.php Reorganize and polish the About WordPress 3.5 screen. Offer strings for translation. 2012-11-28 21:00:09 +00:00
custom-background.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
custom-header.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
customize.php Scope button classes so they can be used on the frontend without interfering with theme styles. 2012-11-30 13:40:59 +00:00
edit-comments.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
edit-form-advanced.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
edit-form-comment.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
edit-link-form.php Remove nearly all tabindex attributes from the admin, leaving them only where absolutely necessary (for now that's only the toolbar). 2012-07-24 00:15:15 +00:00
edit-tag-form.php Enter the semicolon. Props F J Kaiser, SergeyBiryukov. fixes #21393 2012-10-18 13:06:39 +00:00
edit-tags.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
edit.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
export.php Rename filter on $args sent to export_wp() for clarity. See #19863. 2012-11-06 14:51:45 +00:00
freedoms.php Reorganize and polish the About WordPress 3.5 screen. Offer strings for translation. 2012-11-28 21:00:09 +00:00
import.php Pull the list of popular importers from WordPress.org. 2012-11-17 07:20:04 +00:00
index.php We no longer care if wp-admin/index.php is parseable by PHP 4. (And it's not, anyway.) If a user hits the root or wp-admin/install.php, they do get a proper warning. 2012-12-11 16:08:58 +00:00
install-helper.php
install.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
link-add.php
link-manager.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
link-parse-opml.php
link.php Show a better message ondmins on link-manager.php, link-add.php, link.php when links are disabled. 2012-11-27 00:20:27 +00:00
load-scripts.php Script loader: Chunk the script names as passed to load-scripts.php into 128-character pieces. Avoids hitting a limit for the length of a single variable, such as suhosin.get.max_value_length which defaults to 512. fixes #22757. 2012-12-05 18:57:56 +00:00
load-styles.php Fix minified RTL style loading via load-styles.php. props ocean90. fixes #22482. 2012-11-16 22:18:33 +00:00
media-new.php Don't label the form on media-new.php an upload form to avoid esoteric breakage. In past lives, the form has been more complicated than the standard .wp-upload-form use case, with submit buttons that are not just for the uploader, which means we really can't disable them here. 2012-11-27 22:41:15 +00:00
media-upload.php Split media-new.php and media-upload.php into distinct files. 2012-11-21 12:19:40 +00:00
media.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
menu-header.php Pinking shears 2012-11-17 15:11:29 +00:00
menu.php Use the create_posts post type cap in more places. Remove the janky create_posts meta cap. see #16714. 2012-11-28 22:28:20 +00:00
moderation.php
ms-admin.php
ms-delete-site.php Reduce use of global. Use get_blog_details() instead. fixes #22090 2012-10-04 12:40:09 +00:00
ms-edit.php
ms-options.php
ms-sites.php
ms-themes.php
ms-upgrade-network.php
ms-users.php
my-sites.php
nav-menus.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
network.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
options-discussion.php Make 'Show Avatars' a checkbox rather than a yes/no radio button. props tmoorewp, fixes #20889. 2012-09-26 06:44:26 +00:00
options-general.php Don't show the same time or date format twice on the General Settings page. This can occur if a translated format is the same as an existing default format. fixes #21060. 2012-10-25 20:15:47 +00:00
options-head.php
options-media.php Only show help for upload_path and upload_url_path if those fields are visible. fixes #21720. 2012-12-09 17:04:08 +00:00
options-permalink.php Consistently use $wp_rewrite->index instead of hardcoding "index.php". 2013-01-18 13:44:22 +00:00
options-reading.php Revert page on front changes. Reverts [22127] [22129] [22135] [22136]. see #16379. 2012-11-19 01:28:32 +00:00
options-writing.php Make sure .widefat border and background coloring only applies to tables. props MikeHansenMe. fixes #21936. 2013-01-22 14:44:04 +00:00
options.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
plugin-editor.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
plugin-install.php Pinking shears 2012-11-17 15:11:29 +00:00
plugins.php Show plugin activation message when activating a network only plugin on a single site installation. 2012-11-27 16:08:35 +00:00
post-new.php No AYS or autosave for attachments on post.php. Reverts part of [22725]. fixes #22491. 2012-11-27 02:02:32 +00:00
post.php Don't load autosave.js on the attachment editing screen, add simple AYS on unload if there are changes, props helenyhou, fixes #22491 2012-11-20 19:46:38 +00:00
press-this.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
profile.php
revision.php Revisions: Pass the whole revision being filtered along with context about which side it is to the _wp_post_revision_field_$field filters. 2013-02-13 21:42:03 +00:00
setup-config.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
theme-editor.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
theme-install.php Fix help text on the Install Themes screen, props SergeyBiryukov, fixes #20925 2012-08-22 02:28:30 +00:00
themes.php Remove "This theme supports widgets..." from the theme activation notice. props ryanimel. fixes #19787. 2012-09-24 16:31:41 +00:00
tools.php Make sure .widefat border and background coloring only applies to tables. props MikeHansenMe. fixes #21936. 2013-01-22 14:44:04 +00:00
update-core.php Maintain theme screenshot aspect ratio on the update screen. props cochran. fixes #23164. 2013-02-02 17:02:01 +00:00
update.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
upgrade-functions.php
upgrade.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
upload.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
user-edit.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
user-new.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
users.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
widgets.php Fix various typos and omissions across a number of help tabs. props DrewAPicture, Ipstenu. see #22451. 2012-11-22 08:45:15 +00:00