Commit Graph

26 Commits

Author SHA1 Message Date
Andrew Nacin 4b040e72dc WP_Query: `post_parent__in` and `post_parent__not_in`. props wonderboymusic. fixes #11056.
git-svn-id: https://develop.svn.wordpress.org/trunk@23436 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-16 02:08:46 +00:00
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 006d5940cd Try not to send Last-Modified, even with an empty value. Some servers interpret an empty value as the epoch.
Props nacin, slene, SergeyBiryukov, andy
see #23021 for trunk


git-svn-id: https://develop.svn.wordpress.org/trunk@23267 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-04 19:51:31 +00:00
Andrew Nacin 8e674037bc Avoid 'headers already sent' messages for header_remove() the same way we currently do with header(). props ryan. fixes #22258.
git-svn-id: https://develop.svn.wordpress.org/trunk@22303 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-25 20:38:55 +00:00
Andrew Nacin 08dafbce51 Do not issue a Last-Modified header when issuing no-cache headers to avoid aggressive (webkit) caching. Serve a blank header when header_remove() is not available (PHP < 5.3). props andy. fixes #22258.
git-svn-id: https://develop.svn.wordpress.org/trunk@22283 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-23 15:45:44 +00:00
Ryan Boren 7ba5099795 Objects no longer need to be explicitly passed by ref to call_user_func*() to be callable. Props wonderboymusic. fixes #21865
git-svn-id: https://develop.svn.wordpress.org/trunk@22118 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-04 20:00:16 +00:00
Andrew Nacin dfac91464f Remove AtomPub from core.
* Will be replaced with http://wordpress.org/extend/plugins/atom-publishing-protocol/.
 * Introduces an action, xmlrpc_rsd_apis, to add APIs to xmlrpc.php?rsd.
 * Introduces support for 'error' being 403 and 50x in class-wp.php.
 * Removes 'Remote Publishing' from Writing Settings (see [21804]). Keeps the remote_publishing settings section.

DB version is bumped to generate the new wp-app rewrite rule and remove the old enable_app option.

props wonderboymusic.
fixes #21509.



git-svn-id: https://develop.svn.wordpress.org/trunk@21818 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-11 20:11:39 +00:00
Mark Jaquith e7d8706111 Allow home page of multisite (subdir install) sites to resolve regardless of capitalization, as they already do for URLs other than the home page. props SergeyBiryukov. fixes #16200
git-svn-id: https://develop.svn.wordpress.org/trunk@21208 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-05 13:50:24 +00:00
Andrew Nacin 6727ee1a21 Add do_parse_request filter to WP::parse_request() to allow short-circuiting. props andy, mikeschinkel. fixes #16692.
git-svn-id: https://develop.svn.wordpress.org/trunk@21163 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-28 20:03:03 +00:00
Andrew Nacin ee01523b96 Deprecate ancient "debugging" tools.
* logIO() and the global $xmlrpc_logging in XML-RPC.
 * log_app() and the global $app_logging in APP.
 * debug_fwrite(), debug_fopen(), debug_fclose(), and $debug.
see #20051.



git-svn-id: https://develop.svn.wordpress.org/trunk@19935 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-17 00:02:42 +00:00
Ryan Boren a95f44f53f 404 non-existant pages. Make handle_404() readable. Props benbalter, nacin. fixes #15770
git-svn-id: https://develop.svn.wordpress.org/trunk@19892 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-09 21:04:36 +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
Ryan Boren 676ba7043e Use one space, not two, after trailing punctuation. fixes #19537
git-svn-id: https://develop.svn.wordpress.org/trunk@19593 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-13 23:45:31 +00:00
Jon Cave 95b591c1f7 Use correct variable. We preg_match() against $request_match, so that's what should be checked with empty() too. Fixes #17177.
git-svn-id: https://develop.svn.wordpress.org/trunk@19280 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-14 21:05:13 +00:00
Ryan Boren 4399cf7610 Avoid E_STRICT notices. see #18975
git-svn-id: https://develop.svn.wordpress.org/trunk@19094 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-31 19:38:46 +00:00
Andrew Nacin d4bbfbad98 We know that pagename is being assigned to $matches-something, so skip the variable variable. props duck_. see #18991.
git-svn-id: https://develop.svn.wordpress.org/trunk@19017 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-19 22:49:45 +00:00
Andrew Nacin 90f95e0204 new does not require by reference.
git-svn-id: https://develop.svn.wordpress.org/trunk@18995 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-18 20:20:59 +00:00
Jon Cave 205aa5ba5c Fix typos in documentation (wp-includes/[a-h]). See #18560.
git-svn-id: https://develop.svn.wordpress.org/trunk@18633 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-03 16:02:41 +00:00
Mark Jaquith 48d294e7ea Eliminate verbose rewrite rules for ambiguous rewrite structures, resulting in massive performance gains. props andy, otto42, duck_. Nice work everyone! see #16687
git-svn-id: https://develop.svn.wordpress.org/trunk@18541 602fd350-edb4-49c9-b593-d223f7449a82
2011-08-12 01:55:08 +00:00
Ryan Boren 6395eb9ab6 Explain the empty req_uri branch. Props duck_. fixes #17177
git-svn-id: https://develop.svn.wordpress.org/trunk@18467 602fd350-edb4-49c9-b593-d223f7449a82
2011-07-25 20:20:07 +00:00
Ryan Boren 12b5c9c93e Optimize parse_request for the home page. Props duck_. see #17177
git-svn-id: https://develop.svn.wordpress.org/trunk@18466 602fd350-edb4-49c9-b593-d223f7449a82
2011-07-25 20:18:07 +00:00
Andrew Nacin 1df1e7f1b5 Don't 404 for empty post type archives. props markmcwilliams, jfarthing84, fixes #17316.
git-svn-id: https://develop.svn.wordpress.org/trunk@18192 602fd350-edb4-49c9-b593-d223f7449a82
2011-06-08 16:07:38 +00:00
Ryan Boren 9730cb8d15 Constructor cleanup. Props ocean90. fixes #16768
git-svn-id: https://develop.svn.wordpress.org/trunk@17771 602fd350-edb4-49c9-b593-d223f7449a82
2011-04-29 20:05:12 +00:00
scribu eb6a65e501 Move s/ /+ out of WP_Query, so that 'category_name=Some Category' works again. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16526 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-21 16:33:05 +00:00
Andrew Nacin 88fa2b340c File-level phpdoc for new class files. fixes #10287.
git-svn-id: https://develop.svn.wordpress.org/trunk@16101 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-30 14:09:05 +00:00
Andrew Nacin edc329c691 Begin the dissolution of classes.php. see #10287.
git-svn-id: https://develop.svn.wordpress.org/trunk@16099 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-30 07:02:06 +00:00