WordPress/wp-includes
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
..
SimplePie SimplePie: Return nothing and throw an error in SimplePie_Sanitize when DOMDocument is disabled. 2012-12-02 16:43:12 +00:00
Text Update Text_Diff. Props simek. Fixes #9467 2010-02-19 01:25:26 +00:00
css Compress scripts/styles: 3.6-alpha-23408. 2013-02-13 22:58:44 +00:00
images Copy wpspin_light to wp-includes as wpspin.gif. Use it in media views. see #22728. 2012-12-04 16:18:53 +00:00
js Compress scripts/styles: 3.6-alpha-23403. TinyMCE updated. 2013-02-12 22:58:43 +00:00
pomo Avoid 'Only variables should be passed by reference' warning. fixes #23232. 2013-01-31 01:01:19 +00:00
theme-compat Don't return encoded ampersands from get_post_comments_feed_link() to avoid canonical redirect issues. Apply esc_url() when appropriate. 2012-11-07 19:56:10 +00:00
admin-bar.php Display username (user_login) rather than user_nicename in Toolbar. fixes #22121. 2013-01-31 01:39:08 +00:00
atomlib.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
author-template.php Use get_post() instead of global $post. 2012-09-04 16:29:28 +00:00
bookmark-template.php In wp_list_bookmarks(), don't stomp the categorize argument. Fixes categorized display in the links widget. 2012-11-28 23:19:03 +00:00
bookmark.php Don't cache a non-existent link in get_bookmark(). props wonderboymusic, fixes #21159. 2012-09-13 16:41:43 +00:00
cache.php Correct inline docs for cache.php. props ocean90. fixes #23058. 2013-01-22 20:44:30 +00:00
canonical.php Consistently use $wp_rewrite->index instead of hardcoding "index.php". 2013-01-18 13:44:22 +00:00
capabilities.php Pass old roles to set_user_role action. props awellis13. fixes #19134. 2013-01-31 01:15:25 +00:00
category-template.php Don't bail from get_the_terms() if the post type is not registed for the taxonomy. This can break back compat when add_post_type_support( 'page', 'post-formats' ) is called but register_taxonomy_for_object_type( 'postr_-format', 'page' ) is not. 2012-11-20 18:31:06 +00:00
category.php Pinking shears 2012-11-17 15:11:29 +00:00
class-IXR.php Specify the encoding in IXR_Server::output(). Props solarissmoke, sergey.s.betke@novgaro.ru, SergeyBiryukov. fixes #4794 2012-08-15 20:12:00 +00:00
class-feed.php Do SimplePie sanitization with wp_kses_post() rather than DOMDocument, which cannot be guaranteed to be available. 2012-11-22 07:23:43 +00:00
class-http.php HTTP API: Introduce wp_is_writable() to wrap win_is_writable() and is_writable() to work around PHP Windows ACL issues. See #22900 for trunk 2013-01-03 08:04:11 +00:00
class-json.php Update to Services_JSON 1.0.3. props bpetty. fixes #21568. 2013-02-02 02:09:01 +00:00
class-oembed.php Check for DOMDocument when parsing oEmbed XML responses. 2012-12-10 22:49:45 +00:00
class-phpass.php Fix typos in documentation (wp-includes/[a-h]). See #18560. 2011-09-03 16:02:41 +00:00
class-phpmailer.php Do not pass mail() a fourth argument when safe_mode is in effect. 2012-06-26 03:54:17 +00:00
class-pop3.php Update pop3 class. Props aaroncampbell. fixes #17064 2011-04-21 20:40:32 +00:00
class-simplepie.php Update SimplePie to 1.3.1. Props rmccue, ocean90. fixes #22321 2012-11-05 14:25:25 +00:00
class-smtp.php Upgrade PHPMailer to 5.2.1. Props MattyRob. fixes #19887 2012-02-07 16:13:51 +00:00
class-snoopy.php Fix some encoding issues. props hakre, fixes #14735. 2010-10-27 09:54:17 +00:00
class-wp-admin-bar.php Skip To links: visually hide by only setting top: -1000em; (this should make them work well in all screen readers), fixes #21312 2012-11-20 21:14:49 +00:00
class-wp-ajax-response.php Specify the charset in WP_Ajax_Response::send(). Props sergey.s.betke@novgaro.ru, SergeyBiryukov. fixes #19448 2012-08-15 18:17:21 +00:00
class-wp-customize-control.php Customizer uploader control: Pass arrays of extensions around instead. see #22149. 2012-11-10 04:59:46 +00:00
class-wp-customize-manager.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
class-wp-customize-section.php Keyboard accessibility for the theme customizer. props lessbloat, jorbin, JustinSainton. fixes #21283. 2012-11-06 14:47:25 +00:00
class-wp-customize-setting.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
class-wp-editor.php Ensure [23122] gets parsed as context. props TobiasBg. fixes #22808. 2012-12-07 18:50:16 +00:00
class-wp-embed.php Use correct escaping function. props duck_. 2013-01-22 16:37:54 +00:00
class-wp-error.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
class-wp-http-ixr-client.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
class-wp-image-editor-gd.php Only unset() after we have confirmed we are not dealing with a WP_Error. props DH-Shredder. fixes #22824. 2012-12-09 17:02:22 +00:00
class-wp-image-editor-imagick.php Only unset() after we have confirmed we are not dealing with a WP_Error. props DH-Shredder. fixes #22824. 2012-12-09 17:02:22 +00:00
class-wp-image-editor.php Image editors: After cropping, request new sizes from the image. If we rely on the values passed in, they may be floats. We must see what the image results in. 2012-12-06 07:56:04 +00:00
class-wp-theme.php Open external links to plugin homepages, plugin author homepages, and theme author homepages in a new window/tab. props SergeyBiryukov. fixes #20839. 2013-02-08 16:20:01 +00:00
class-wp-walker.php Make sure the array exists before adding an element to it. props rodrigosprimo. fixes #23272. 2013-01-25 12:24:10 +00:00
class-wp-xmlrpc-server.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
class-wp.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
class.wp-dependencies.php Revert [21420] and [21481]. Accepting a string caused back compat problems including the possibility of revealing previously hidden circular dependencies resulting in infinite loops. 2012-10-23 20:32:12 +00:00
class.wp-scripts.php Allow protocol-relative URLs when registering/enqueueing scripts and styles. 2012-06-28 20:18:38 +00:00
class.wp-styles.php Allow protocol-relative URLs when registering/enqueueing scripts and styles. 2012-06-28 20:18:38 +00:00
comment-template.php Put required field indicators within labels. Update styling of bundled themes to accommodate. Props MikeHansenMe. fixes #21897 2012-10-05 16:34:32 +00:00
comment.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
compat.php Restore compat for json_decode and json_encode. fixes #18015 for trunk. 2011-07-06 23:33:05 +00:00
cron.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
default-constants.php Whitespace cleanup. 2013-01-21 14:39:39 +00:00
default-filters.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
default-widgets.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
deprecated.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
feed-atom-comments.php its <=> it's in documentation, along with a rogue the, The, and looses. props trepmal. fixes #22665. 2012-12-20 15:55:32 +00:00
feed-atom.php Don't return encoded ampersands from get_post_comments_feed_link() to avoid canonical redirect issues. Apply esc_url() when appropriate. 2012-11-07 19:56:10 +00:00
feed-rdf.php Add the generator element in feeds through the {rss2|atom|rdf|rss|opml}_head hooks. Fixes #6947 props sivel. 2010-02-13 16:45:16 +00:00
feed-rss.php Use the site's locale for the feed language. Provides the same result as language_attributes(). Removes the rss_language option. fixes #13440. see #5517. 2012-01-29 19:56:33 +00:00
feed-rss2-comments.php Use get_search_query() in feed-rss2-comments.php. Props SergeyBiryukov. fixes #21365 2012-07-25 18:04:17 +00:00
feed-rss2.php Use the_content_feed() when looking for zero-length post content for RSS2 feeds. Now you can have blank posts with content generated by the_content filters. props SergeyBiryukov. fixes #15604 2012-07-09 03:33:01 +00:00
feed.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
formatting.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
functions.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
functions.wp-scripts.php Add underscore and backbone to the do-not-deregister list of scripts. 2013-02-08 05:11:27 +00:00
functions.wp-styles.php Stop recommending the init hook in the _doing_it_wrong() message for too-early scripts and styles. Instead, recommend the three _enqueue_scripts hooks. If they're noticing they are doing it wrong, let's push them to 100% correct, not partly correct. 2013-02-02 02:42:09 +00:00
general-template.php Use microtime() instead of incrementors for last_changed to to avoid race conditions with cache evictions. 2013-02-11 18:08:14 +00:00
http.php Handle pre-flighted OPTIONS requests in send_origin_headers(). Props nacin. fixes #21024 2012-09-24 21:39:04 +00:00
kses.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
l10n.php Theme Translations: Allow for theme pomo files to be loaded from WP_LANG_DIR/themes/{$domain}-{$locale}.(p|m)o. 2012-10-31 21:30:33 +00:00
link-template.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
load.php Ensure we have a charset before calling mb_internal_encoding(), avoiding an unnecessary (if suppressed) warning. props dfavor. fixes #23093. 2013-02-02 02:01:29 +00:00
locale.php Add a translator's comment. see #19924. 2012-02-06 19:43:26 +00:00
media-template.php Media: Restore 3.4 behavior by consulting the old-school DB options for default align, size, and link properties. 2013-01-04 08:02:16 +00:00
media.php Return from image_downsize() earlier if a custom resize function is used. props anatolbroder. fixes #23392. 2013-02-14 04:30:55 +00:00
meta.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
ms-blogs.php its <=> it's in documentation, along with a rogue the, The, and looses. props trepmal. fixes #22665. 2012-12-20 15:55:32 +00:00
ms-default-constants.php Multisite in a subdirectory: For subdomain installs, use a root admin cookie path, not a wp-admin specific one. 2012-12-04 00:51:02 +00:00
ms-default-filters.php Remove ms-files.php rewriting from WordPress multisite. fixes #19235. 2012-09-11 22:22:20 +00:00
ms-deprecated.php Undeprecate *_blog_option() by popular demand. Put them back in ms-blogs.php since direct inclusion of ms-blogs.php/ms-functions.php is unforntunately common. 2012-08-08 17:11:15 +00:00
ms-files.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
ms-functions.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
ms-load.php Merge two strings. props pavelevap, see #22306. 2012-11-07 22:03:23 +00:00
ms-settings.php Resurrect the switched global. Some are still using it. see #21459 2012-08-22 03:34:00 +00:00
nav-menu-template.php Declare wp_rewrite as global in _wp_menu_item_classes_by_context(). 2013-01-21 14:44:30 +00:00
nav-menu.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
option.php Trim the option name in get_option() before calling the pre_option_$option filter, not after. props evansolomon. fixes #22358. 2012-11-17 13:20:57 +00:00
pluggable-deprecated.php Correct the deprecated notice in AtomPub's deprecated class. see #22855. 2012-12-26 20:35:27 +00:00
pluggable.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
plugin.php Correct phpdoc for wp-includes/plugin.php: wp-content/plugins/, not wp-content/plugin/. props technosailor. fixes #23024. 2012-12-20 15:49:55 +00:00
post-template.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
post-thumbnail-template.php Fix the PHPDoc for the_post_thumbnail(). props georgestephanis. fixes #22885 2012-12-29 17:59:08 +00:00
post.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
query.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
registration-functions.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
registration.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
rewrite.php Consistently use $wp_rewrite->index instead of hardcoding "index.php". 2013-01-18 13:44:22 +00:00
rss-functions.php Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
rss.php its <=> it's in documentation, along with a rogue the, The, and looses. props trepmal. fixes #22665. 2012-12-20 15:55:32 +00:00
script-loader.php Revert [23375] until we can get Media fixed to work with newer versions of Backbone. see #23262 2013-02-08 03:15:22 +00:00
shortcodes.php Update shortcode regular expression commentary. See #17657. 2012-11-06 14:47:33 +00:00
taxonomy.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
template-loader.php Clean up [22347] a bit. see #14348 2012-10-31 23:01:13 +00:00
template.php Make sure .widefat border and background coloring only applies to tables. props MikeHansenMe. fixes #21936. 2013-01-22 14:44:04 +00:00
theme.php Properly check if the custom header/background has been initialized. fixes #23170. see #22246. 2013-02-01 20:33:27 +00:00
update.php Tighten our braces. Fixes #23118 props evansolomon. 2013-01-04 10:13:51 +00:00
user.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
vars.php TinyMCE: better exclusion of Opera mobile, fixes #21416 2012-07-30 19:40:52 +00:00
version.php Compress scripts/styles: 3.6-alpha-23408. 2013-02-13 22:58:44 +00:00
widgets.php Change all core API to expect unslashed rather than slashed arguments. 2013-02-14 22:51:06 +00:00
wlwmanifest.xml Lose EOF ?>. Clean up EOF newlines. fixes #12307 2012-01-08 17:01:11 +00:00
wp-db.php Enforce a minimum of two arguments for wpdb::prepare(). The first argument is the query (or fragment thereof), which is required. Additional arguments are values to substitute into placeholders. 2012-11-07 19:30:59 +00:00
wp-diff.php Objects no longer need to be explicitly passed by ref to call_user_func*() to be callable. Props wonderboymusic. fixes #21865 2012-10-04 20:00:16 +00:00