Commit Graph

39 Commits

Author SHA1 Message Date
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
Sergey Biryukov ee16ed9e0b Correct return value for comment_exists(). fixes #20494.
git-svn-id: https://develop.svn.wordpress.org/trunk@23433 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-15 18:49:07 +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
Sergey Biryukov b96d467630 Add missing inline descriptions.
props momo360modena, aaronholbrook.
see #20494, fixes #23304.

git-svn-id: https://develop.svn.wordpress.org/trunk@23350 602fd350-edb4-49c9-b593-d223f7449a82
2013-01-28 02:20:47 +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 ecfd980687 Use edit_comment cap. Props casben79. fixes #16129
git-svn-id: https://develop.svn.wordpress.org/trunk@17232 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-07 16:17:05 +00:00
Andrew Nacin af29b5d5cf phpdoc, @since, whitespace. Also require an argument in wp_insert_post(). props duck_, see #14783.
git-svn-id: https://develop.svn.wordpress.org/trunk@15564 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-05 02:45:39 +00:00
scribu 316ce57342 Add the floated_admin_avatar filter from WP_Comments_Table. See #14637
git-svn-id: https://develop.svn.wordpress.org/trunk@15512 602fd350-edb4-49c9-b593-d223f7449a82
2010-08-20 11:18:41 +00:00
Peter Westwood a85f6a4122 Just pass the comment object to get_avatar in floated_admin_avatar rather than duplicating logic. Fixes #12291 props Otto42.
git-svn-id: https://develop.svn.wordpress.org/trunk@13420 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-25 22:19:03 +00:00
Ryan Boren 8ef8b7bad5 Trailing whitespace cleanup
git-svn-id: https://develop.svn.wordpress.org/trunk@12733 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-15 22:11:12 +00:00
Peter Westwood 60d271287e Improve get_pending_comments_num() to be a little more predictable and revert the erroneous change in [12596]. See #11882.
git-svn-id: https://develop.svn.wordpress.org/trunk@12715 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-12 22:38:26 +00:00
Peter Westwood 5b481ca51a phpDoc for get_pending_comments_num().
git-svn-id: https://develop.svn.wordpress.org/trunk@12595 602fd350-edb4-49c9-b593-d223f7449a82
2010-01-02 17:15:11 +00:00
Andrew Ozz c7a3747476 Properly escape comment_author_url when displaying, for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@11721 602fd350-edb4-49c9-b593-d223f7449a82
2009-07-18 23:21:50 +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
Peter Westwood 68af1abbe0 Fix notice when registering admin avatar filter. See #9366 props sivel
git-svn-id: https://develop.svn.wordpress.org/trunk@10821 602fd350-edb4-49c9-b593-d223f7449a82
2009-03-19 21:52:50 +00:00
Ryan Boren a5740e48a1 post_exists() and comment_exists() fixes. Fixes post duplication during import. Props tott. fixes #8460
git-svn-id: https://develop.svn.wordpress.org/trunk@10722 602fd350-edb4-49c9-b593-d223f7449a82
2009-03-05 22:16:29 +00:00
Ryan Boren 2601e590b2 Add opt-in optioon for comment hotkeys. Props nbachiyski. fixes #7643
git-svn-id: https://develop.svn.wordpress.org/trunk@9217 602fd350-edb4-49c9-b593-d223f7449a82
2008-10-16 22:23:32 +00:00
Ryan Boren 6d727a9c2b phpdoc for wp-admin. Props jacobsantos. see #7527
git-svn-id: https://develop.svn.wordpress.org/trunk@9119 602fd350-edb4-49c9-b593-d223f7449a82
2008-10-10 18:21:16 +00:00
Ryan Boren 63ff25ab3b Punt inbox
git-svn-id: https://develop.svn.wordpress.org/trunk@9005 602fd350-edb4-49c9-b593-d223f7449a82
2008-09-27 20:41:29 +00:00
Ryan Boren 3e43adeb6e phpdoc for wp-admin/includes from jacobsantos. see #7527
git-svn-id: https://develop.svn.wordpress.org/trunk@8912 602fd350-edb4-49c9-b593-d223f7449a82
2008-09-17 00:40:10 +00:00
Ryan Boren 602c2f366d Revert [8881], patch wasn't ready. see #7738
git-svn-id: https://develop.svn.wordpress.org/trunk@8882 602fd350-edb4-49c9-b593-d223f7449a82
2008-09-13 18:18:44 +00:00
Ryan Boren cd225e64bd Hook floated_admin_avatar to admin_init. Props DD32. fixes #7738
git-svn-id: https://develop.svn.wordpress.org/trunk@8881 602fd350-edb4-49c9-b593-d223f7449a82
2008-09-13 18:16:42 +00:00
Ryan Boren 6db75e59d4 Collapse crazyhorse to trunk. Incoming! see #7552
git-svn-id: https://develop.svn.wordpress.org/trunk@8691 602fd350-edb4-49c9-b593-d223f7449a82
2008-08-20 21:42:31 +00:00
Peter Westwood ab17f7283c phpdoc for wp-admin. See #7496 props santosj.
git-svn-id: https://develop.svn.wordpress.org/trunk@8645 602fd350-edb4-49c9-b593-d223f7449a82
2008-08-14 06:30:38 +00:00
Ryan Boren 6964bbbcde Consolidate get_pending_comments_num() queries. see #6770
git-svn-id: https://develop.svn.wordpress.org/trunk@7775 602fd350-edb4-49c9-b593-d223f7449a82
2008-04-22 21:26:01 +00:00
Ryan Boren fdc05b24f6 Prepare DB queries in more places. Props filosofo. see #6644
git-svn-id: https://develop.svn.wordpress.org/trunk@7645 602fd350-edb4-49c9-b593-d223f7449a82
2008-04-14 16:13:25 +00:00
Ryan Boren d7f9059180 Update timestamp when only the minute value is changed. fixes #6456 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@7609 602fd350-edb4-49c9-b593-d223f7449a82
2008-04-07 17:06:56 +00:00
Mark Jaquith 8b6ba65861 moderation.php is no more. All hail edit-comments.php?comment_status=moderated
git-svn-id: https://develop.svn.wordpress.org/trunk@7391 602fd350-edb4-49c9-b593-d223f7449a82
2008-03-18 23:24:04 +00:00
Ryan Boren 56a7acdf15 Better date editing from MarkJaquith. see #6250
git-svn-id: https://develop.svn.wordpress.org/trunk@7338 602fd350-edb4-49c9-b593-d223f7449a82
2008-03-16 23:05:16 +00:00
Ryan Boren 6d7441c26e Remove trailing whites.
git-svn-id: https://develop.svn.wordpress.org/trunk@7130 602fd350-edb4-49c9-b593-d223f7449a82
2008-03-02 20:17:30 +00:00
Ryan Boren 19f94ceb41 Fix backend avatar display
git-svn-id: https://develop.svn.wordpress.org/trunk@6883 602fd350-edb4-49c9-b593-d223f7449a82
2008-02-17 01:57:58 +00:00
Matt Mullenweg 44ab02799d Avatars for backend.
git-svn-id: https://develop.svn.wordpress.org/trunk@6868 602fd350-edb4-49c9-b593-d223f7449a82
2008-02-16 02:39:13 +00:00
Ryan Boren 721b8c930b Remove unused variables. Props DD32. fixes #5418
git-svn-id: https://develop.svn.wordpress.org/trunk@6354 602fd350-edb4-49c9-b593-d223f7449a82
2007-12-05 00:29:05 +00:00
Matt Mullenweg f57bf53f8f Shows pending moderation comments in title and bold comment numbers with comments that need attention.
git-svn-id: https://develop.svn.wordpress.org/trunk@5821 602fd350-edb4-49c9-b593-d223f7449a82
2007-07-29 19:56:55 +00:00
Mark Jaquith a58adaafff get_comment_to_edit() should return false when the comment does not exist or is marked as spam. props Westi. fixes #4533.
git-svn-id: https://develop.svn.wordpress.org/trunk@5757 602fd350-edb4-49c9-b593-d223f7449a82
2007-06-25 21:30:18 +00:00
Ryan Boren b18cb943b6 Remove comment_text filter from get_comment_to_edit. fixes #4403 for 2.3
git-svn-id: https://develop.svn.wordpress.org/trunk@5655 602fd350-edb4-49c9-b593-d223f7449a82
2007-06-05 14:41:02 +00:00
Ryan Boren 6aa3a65c02 Run comment_text filter before format_to_edit() when getting a comment to edit. fixes #4403 for 2.3
git-svn-id: https://develop.svn.wordpress.org/trunk@5646 602fd350-edb4-49c9-b593-d223f7449a82
2007-06-04 17:43:22 +00:00
Ryan Boren f1a0a595d7 attribute_escape()s and int casts. see #4333
git-svn-id: https://develop.svn.wordpress.org/trunk@5543 602fd350-edb4-49c9-b593-d223f7449a82
2007-05-25 09:41:04 +00:00
Ryan Boren 09f70467e0 Admin includes reorg. see #4334
git-svn-id: https://develop.svn.wordpress.org/trunk@5542 602fd350-edb4-49c9-b593-d223f7449a82
2007-05-25 07:16:21 +00:00