Commit Graph

15 Commits

Author SHA1 Message Date
Ryan Boren a6c8efadb9 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: https://develop.svn.wordpress.org/trunk@23416 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-14 22:51:06 +00:00
Ryan Boren 2b186b0c45 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: https://develop.svn.wordpress.org/trunk@19712 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-08 17:01:11 +00:00
Andrew Nacin a0cd13553b trailingslashit isn't normally available in ms-files. props davecpage, fixes #18592.
git-svn-id: https://develop.svn.wordpress.org/trunk@18642 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-06 15:41:57 +00:00
Andrew Nacin 6fa5b1ed74 Force a trailing slash on BLOGUPLOADDIR in ms-files.php. props wonderboymusic, see #18592.
git-svn-id: https://develop.svn.wordpress.org/trunk@18638 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-05 16:55:05 +00:00
Ryan Boren 343de36521 s/Content-type/Content-Type/. Props dvwallin. fixes #17256
git-svn-id: https://develop.svn.wordpress.org/trunk@17922 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-13 19:31:36 +00:00
Peter Westwood bf878cad07 Ensure we don't generate incorrect content types when files are requested with query strings. Fixes #14450 props chrisbliss18.
git-svn-id: https://develop.svn.wordpress.org/trunk@15749 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-07 21:00:45 +00:00
Ron Rennick ddcf72d638 block ms-files.php when not multisite, see #11742
git-svn-id: https://develop.svn.wordpress.org/trunk@14609 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-13 21:40:42 +00:00
Peter Westwood e8f1acbf41 Remove blank data and lines after the closing ?> which can break image display for multisite.
git-svn-id: https://develop.svn.wordpress.org/trunk@14078 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-13 17:13:28 +00:00
Andrew Nacin 363ba99066 Remove conditionally declared wp_check_filetype() from ms-files.php. It will always be defined in functions.php. see #11644
git-svn-id: https://develop.svn.wordpress.org/trunk@13682 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-12 00:38:04 +00:00
Andrew Nacin 13d3a5bb5b Remove wp-content/blogs.php and add deprecated warning for MU admins. fixes #11742
git-svn-id: https://develop.svn.wordpress.org/trunk@13514 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-28 20:29:24 +00:00
Peter Westwood 2b3837f55a Improve the implementation of the default constant defining functions for multisite. See #11881.
git-svn-id: https://develop.svn.wordpress.org/trunk@13065 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-12 08:22:34 +00:00
Ron Rennick bc3d44241d revert remove error_reporting from ms-files.php, remove _deprecated_file call from blogs.php, see #11742
git-svn-id: https://develop.svn.wordpress.org/trunk@13040 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-09 18:22:21 +00:00
Ron Rennick ae2abd74d9 remove error_reporting from ms-files.php, see #11742
git-svn-id: https://develop.svn.wordpress.org/trunk@13038 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-09 16:44:40 +00:00
Ron Rennick fdcbef3e84 restore shell wp-content/blogs.php & add deprecated warnings, props nacin, see #11742
git-svn-id: https://develop.svn.wordpress.org/trunk@12977 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-05 21:40:22 +00:00
Ron Rennick 012732f59d improvements to custom content dir support, props nacin, see #11742
git-svn-id: https://develop.svn.wordpress.org/trunk@12936 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-03 18:19:56 +00:00