Commit Graph

103 Commits

Author SHA1 Message Date
Sergey Biryukov 2b1420456d Fix typos in phpdoc. props TheLastCicada. fixes #24302.
git-svn-id: https://develop.svn.wordpress.org/trunk@24229 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-10 01:39:30 +00:00
Andrew Nacin a77be61eb6 Document that fetch_feed() can accept multiple URLs, thus leveraging SimplePie's multifeed feature. props JustinSainton, fixes #22140.
git-svn-id: https://develop.svn.wordpress.org/trunk@24054 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-22 20:24:41 +00:00
Andrew Nacin 11b772ea05 Add filters to comments_link_feed(), comment_link(), and get_comments_link(). esc_url() the echoed output of comments_link().
props MarcusPope.
fixes #19210.



git-svn-id: https://develop.svn.wordpress.org/trunk@23624 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-06 19:57:31 +00:00
Ryan Boren b78520da15 Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
see #WP21767


git-svn-id: https://develop.svn.wordpress.org/trunk@23591 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-03 16:30:38 +00:00
Ryan Boren c363aea627 Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767
git-svn-id: https://develop.svn.wordpress.org/trunk@23554 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-01 16:28:40 +00:00
Andrew Nacin 9d885adce3 Add self_link filter to self_link(). props josephscott. fixes #10434.
git-svn-id: https://develop.svn.wordpress.org/trunk@23521 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-28 18:27:13 +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
Andrew Nacin eb6ec0d669 Do SimplePie sanitization with wp_kses_post() rather than DOMDocument, which cannot be guaranteed to be available.
Overrides SimplePie_Sanitize with WP_SimplePie_Sanitize_KSES.

props markjaquith, rmccue.
see #21990.



git-svn-id: https://develop.svn.wordpress.org/trunk@22811 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-22 07:23:43 +00:00
Andrew Nacin 709b1f25d0 Remove SimplePie 1.2/1.3 compatibility code no longer needed with 1.3.1. see #22321. see #21183.
git-svn-id: https://develop.svn.wordpress.org/trunk@22599 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-15 09:51:02 +00:00
Andrew Nacin 774a12be83 Introduce constants to allow for easier expression of time periods in seconds. Adds MINUTE_IN_SECONDS, HOUR_IN_SECONDS, DAY_IN_SECONDS, WEEK_IN_SECONDS, YEAR_IN_SECONDS. props nbachiyski, SergeyBiryukov. fixes #20987.
git-svn-id: https://develop.svn.wordpress.org/trunk@21996 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-25 05:26:19 +00:00
Ryan Boren 92ea34f6a2 Use set_url_scheme(). Props johnbillion, MarcusPope. see #19037 #20759
git-svn-id: https://develop.svn.wordpress.org/trunk@21664 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-30 13:33:00 +00:00
Andrew Nacin 3064c6d713 Stabilize how WordPress hooks into SimplePie to implement transient caching.
Since a plugin can load a previous (< 1.3) version of SimplePie before we do,
we need to be compatible with our old method of overriding SimplePie_Cache::create().

SimplePie_Cache::create() was converted to static in 1.3 (as it was called),
requiring that we create two different definitions of WP_Feed_Cache (extends
SimplePie_Cache). Instead, we can use 1.3's new object registry, and leave
the old WP_Feed_Cache to SimplePie 1.2 versions.

see #21183.



git-svn-id: https://develop.svn.wordpress.org/trunk@21652 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-29 00:25:52 +00:00
Mark Jaquith 68ff684271 Supply the missing @return doc for get_the_content_feed(). props c3mdigital. fixes #21148
git-svn-id: https://develop.svn.wordpress.org/trunk@21239 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-09 04:51:00 +00:00
Jon Cave 156048ca52 split was deprecated in PHP 5.3.0, so use explode instead. Props garyc40. Fixes #16325.
git-svn-id: https://develop.svn.wordpress.org/trunk@19726 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-09 21:20:51 +00:00
Dion Hulse 5f0ae29771 Use is_ssl() in self_link(). Fixes #19563
git-svn-id: https://develop.svn.wordpress.org/trunk@19598 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-16 02:48:02 +00:00
Andrew Nacin 36776d3bb0 Restore RDF feed. fixes #4967.
git-svn-id: https://develop.svn.wordpress.org/trunk@19364 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-20 18:32:42 +00:00
Mark Jaquith 47bf346a9f Deprecate RSS 0.92 and RDF feeds, and 301 them to the default feed. props johnpbloch. fixes #4967
git-svn-id: https://develop.svn.wordpress.org/trunk@18537 602fd350-edb4-49c9-b593-d223f7449a82
2011-08-11 23:30:59 +00:00
Ryan Boren 36a4508140 Update since phpdoc. Props demetris. fixes #15445
git-svn-id: https://develop.svn.wordpress.org/trunk@16660 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-01 19:24:38 +00:00
Peter Westwood b08df21c26 Revert most of [16332] - renaming and deprecating a commonly used function is silly. Improving it is good. Fixes #15407.
git-svn-id: https://develop.svn.wordpress.org/trunk@16334 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-12 21:53:15 +00:00
scribu 11f20d737c Replace get_the_category() with get_the_categories(). Props filosofo. Fixes #15407
git-svn-id: https://develop.svn.wordpress.org/trunk@16332 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-12 20:05:37 +00:00
Andrew Nacin 60c561889b Pass feed type from the_content_feed to get_the_content_feed. props peaceablewhale, fixes #14214.
git-svn-id: https://develop.svn.wordpress.org/trunk@15371 602fd350-edb4-49c9-b593-d223f7449a82
2010-07-06 20:41:07 +00:00
Ryan Boren 0922715668 Cut 'em out, move 'em on, trailing whitespace
git-svn-id: https://develop.svn.wordpress.org/trunk@15116 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-02 20:04:07 +00:00
Andrew Nacin 42bad1e654 Final bit of escaping in feeds. fixes #13555
git-svn-id: https://develop.svn.wordpress.org/trunk@14952 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-26 18:30:51 +00:00
Peter Westwood de09357409 Some more url escaping in feeds. See #13555.
git-svn-id: https://develop.svn.wordpress.org/trunk@14950 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-26 17:47:29 +00:00
Ryan Boren 974b6c1ce4 Introduce home_url(). Props Denis-de-Bernardy, hakre. see #9008
git-svn-id: https://develop.svn.wordpress.org/trunk@12598 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-04 17:23:29 +00:00
Peter Westwood 6979dbdc02 Pass the url to the 'wp_feed_cache_transient_lifetime' filter to give more context.
Allow plugins to set extra options on SimplePie using the new 'wp_feed_options' action.
Fixes #11117 props nacin.

git-svn-id: https://develop.svn.wordpress.org/trunk@12484 602fd350-edb4-49c9-b593-d223f7449a82
2009-12-22 12:48:40 +00:00
Ryan Boren 6266cbaf3b Ue get_default_feed() for *_the_category_rss(). Props filosofo, peaceablewhale. fixes #5802
git-svn-id: https://develop.svn.wordpress.org/trunk@12197 602fd350-edb4-49c9-b593-d223f7449a82
2009-11-17 16:27:36 +00:00
Ryan Boren 2cb6b5469d Deprecates the_content_rss(). Add the_content_feed() and get_the_content_feed(). Convert places that called the_content_rss() with an excerpt length to the_excerpt_rss(). Remove the rss_excerpt_length option. Use the_content_feed() where the_content() was previously used in feeds. Props Viper007Bond.
git-svn-id: https://develop.svn.wordpress.org/trunk@11980 602fd350-edb4-49c9-b593-d223f7449a82
2009-09-28 14:36:48 +00:00
Peter Westwood 1b7643d281 Remove context from wp_feed_cache_transient_lifetime filter and filter in fetch_feed as well. Fixes #9926.
git-svn-id: https://develop.svn.wordpress.org/trunk@11453 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-25 09:13:48 +00:00
Mark Jaquith ba1c3bdd5b Deprecate sanitize_url() and clean_url() in favor of esc_url_raw() and esc_url()
git-svn-id: https://develop.svn.wordpress.org/trunk@11383 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-18 16:00:33 +00:00
Mark Jaquith f0336cfa7d deprecate wp_specialchars() in favor of esc_html(). Encode quotes for esc_html() as in esc_attr(), to improve plugin security.
git-svn-id: https://develop.svn.wordpress.org/trunk@11380 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-18 15:11:07 +00:00
Ryan Boren 6a66b51970 Fix feed autodiscovery. Props peaceablewhale. fixes #9810
git-svn-id: https://develop.svn.wordpress.org/trunk@11358 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-16 05:15:21 +00:00
Ryan Boren d892f1f557 Use text/xml for rss feeds for best browser compat. Props Denis-de-Bernardy. fixes #9810
git-svn-id: https://develop.svn.wordpress.org/trunk@11334 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-14 21:21:31 +00:00
Mark Jaquith c638e8d8de _a(), _ea(), _xa(), attr() are now esc_attr__(), esc_attr_e(), esc_attr_x(), esc_attr() -- still short, but less cryptic. see #9650
git-svn-id: https://develop.svn.wordpress.org/trunk@11204 602fd350-edb4-49c9-b593-d223f7449a82
2009-05-05 19:43:53 +00:00
Ryan Boren fe7c34b6fd s/attribute_escape/attr/. see #9650
git-svn-id: https://develop.svn.wordpress.org/trunk@11109 602fd350-edb4-49c9-b593-d223f7449a82
2009-04-28 05:58:45 +00:00
Ryan Boren ea6c1efcb9 Silence html_entity_decode warnings. Props Denis-de-Bernardy. fixes #9616
git-svn-id: https://develop.svn.wordpress.org/trunk@11081 602fd350-edb4-49c9-b593-d223f7449a82
2009-04-24 16:57:27 +00:00
Ryan Boren ae126fa1f8 Remove leading newlines. Props filosofo. fixes #9096
git-svn-id: https://develop.svn.wordpress.org/trunk@10758 602fd350-edb4-49c9-b593-d223f7449a82
2009-03-10 18:25:04 +00:00
Ryan Boren 91e3bd9358 Pass blog charset to html_entity_decode(). Props adferguson. fixes #7563
git-svn-id: https://develop.svn.wordpress.org/trunk@10688 602fd350-edb4-49c9-b593-d223f7449a82
2009-03-03 18:37:25 +00:00
Ryan Boren b68fd0794e Use WordPress HTTP class for SimplePie requests. Props DD32. fixes #9247
git-svn-id: https://develop.svn.wordpress.org/trunk@10687 602fd350-edb4-49c9-b593-d223f7449a82
2009-03-03 17:41:01 +00:00
Ryan Boren 148083569f phpdoc for fetch_feed(). Props rmmcue. see #9198
git-svn-id: https://develop.svn.wordpress.org/trunk@10671 602fd350-edb4-49c9-b593-d223f7449a82
2009-02-28 01:50:47 +00:00
Ryan Boren 7062db47c2 Use SimplePie for widget and dashboard feeds. First cut. see #9198
git-svn-id: https://develop.svn.wordpress.org/trunk@10666 602fd350-edb4-49c9-b593-d223f7449a82
2009-02-27 19:32:50 +00:00
Andrew Ozz b5e8ea9436 Fix regex in function rss_enclosure(), fixes #9192
git-svn-id: https://develop.svn.wordpress.org/trunk@10615 602fd350-edb4-49c9-b593-d223f7449a82
2009-02-21 06:14:52 +00:00
Ryan Boren 9dbfa279af Use guid instead of link for atom comment IDs. fixes #8708 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@10385 602fd350-edb4-49c9-b593-d223f7449a82
2009-01-20 20:55:03 +00:00
Andrew Ozz 19577d0a8d Add support for automatic feed links in themes, props Viper007Bond, see #8878
git-svn-id: https://develop.svn.wordpress.org/trunk@10377 602fd350-edb4-49c9-b593-d223f7449a82
2009-01-19 05:04:58 +00:00
Ryan Boren 51406e542e Clean comment link. Props nbachiyski. fixes #8405 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@10332 602fd350-edb4-49c9-b593-d223f7449a82
2009-01-08 04:31:08 +00:00
Ryan Boren baaaa352ba Strip trailing whitespace
git-svn-id: https://develop.svn.wordpress.org/trunk@10150 602fd350-edb4-49c9-b593-d223f7449a82
2008-12-09 18:03:31 +00:00
Ryan Boren 920b968be8 Use home to determine self link host
git-svn-id: https://develop.svn.wordpress.org/trunk@9769 602fd350-edb4-49c9-b593-d223f7449a82
2008-11-18 23:04:42 +00:00
Mark Jaquith fe5fb55c3b Use clean_url() in self_link(), for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@9753 602fd350-edb4-49c9-b593-d223f7449a82
2008-11-18 08:24:17 +00:00
Ryan Boren 9db325beab Use only one enclosure type. Props hailin. fixes #8017
git-svn-id: https://develop.svn.wordpress.org/trunk@9501 602fd350-edb4-49c9-b593-d223f7449a82
2008-11-03 20:19:38 +00:00
Matt Mullenweg 028cee6d66 Don't encoded category element contents - fixes #4321 and #7815.
git-svn-id: https://develop.svn.wordpress.org/trunk@9148 602fd350-edb4-49c9-b593-d223f7449a82
2008-10-14 01:08:56 +00:00