WordPress/wp-admin
Scott Taylor daa4b531e8 Fix several esoteric errors related to AJAX unit tests for comments:
* `wp_ajax_get_comments()` relies on the `$post_id` global - even though `$_POST['p']` is passed to every action in the test methods. If `$post_id` is still lingering in between tests and doesn't match `p` in the request, the cap check might pass while the queries for comments will blow up. I added `unset( $GLOBALS['post_id'] )` to `Tests_Ajax_GetComments::setUp()`.
* If the global `$post_id` is empty, but `$_REQUEST['p']` is not, `$post_id` is now set to `absint( $_REQUEST['p'] )` and sanity-checked in `wp_ajax_get_comments()`.
* `map_meta_cap()` always assumes that `get_comment()` succeeds when checking for the `edit_comment` cap. It doesn't. I added sanity checks in a few places where it will break early if `get_post()` or `get_comment()` are empty.
* `wp_update_comment()` always assumes `get_comment()` succeeds. It doesn't. I added a check for empty.

All AJAX unit tests run and pass in debug mode. All general unit tests pass against these changes.

Fixes #25282.


Built from https://develop.svn.wordpress.org/trunk@25438


git-svn-id: http://core.svn.wordpress.org/trunk@25360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-14 18:36:09 +00:00
..
css Set min-height for menu item title. props garyc40. fixes #16787. 2013-09-02 17:35:10 +00:00
images Update about page for new screenshot and new video encoding. Remove old screenshots directory. fixes #24832. 2013-08-01 13:29:29 +00:00
includes Fix several esoteric errors related to AJAX unit tests for comments: 2013-09-14 18:36:09 +00:00
js Fix folding/unfolding of the admin menu on new installs, props SergeyBiryukov, fixes #24921 for 3.6.1. 2013-08-30 17:11:08 +00:00
maint
network Stop using get_blogaddress_by_domain() when updating the siteurl/homeurl from the network admin. 2013-09-05 18:49:09 +00:00
user
about.php Make the About video responsive. 2013-08-01 16:16:58 +00:00
admin-ajax.php Cleanup of the revisions screen, both on the PHP API side, and the JS. 2013-06-26 21:06:50 +00:00
admin-footer.php Correct @since in admin-footer. see #25229. 2013-09-06 17:38:09 +00:00
admin-functions.php
admin-header.php Add post-type-$post_type and taxonomy-$taxonomy admin body classes. 2013-08-26 18:18:09 +00:00
admin-post.php send_origin_headers() in admin-post.php. 2013-08-16 19:59:08 +00:00
admin.php
async-upload.php Use meta caps edit_post, read_post, and delete_post directly, rather than consulting the post type object. map_meta_cap() handles that for us. props markjaquith, kovshenin. fixes #23226. 2013-07-08 20:05:42 +00:00
comment.php Document comment_edit_redirect. 2013-09-06 17:01:09 +00:00
credits.php Copy about.php string to freedoms and credits. Update CSS for 3.6 credits. see #24832. 2013-07-31 06:04:41 +00:00
custom-background.php Mark the hooks in custom-background.php as duplicates. 2013-09-06 17:05:09 +00:00
custom-header.php Remove lingering instances of call time pass-by-reference, limited to instances of callable - use $this instead of &$this. 2013-09-05 16:34:09 +00:00
customize.php Fixes and tweaks for the metabox accordion. 2013-07-18 17:42:53 +00:00
edit-comments.php * Pass ellipsis as a parameter to wp_html_excerpt() instead of appending it manually. 2013-05-09 00:22:02 +00:00
edit-form-advanced.php Don't show the "Get Shortlink" button for pages with a ?page_id=x permalink. 2013-08-26 16:06:08 +00:00
edit-form-comment.php Show the IP address, if available, in the comment edit screen submit meta box. props leewillis77. fixes #24638. 2013-09-10 14:41:11 +00:00
edit-link-form.php
edit-tag-form.php Add actions for term editing/creation form tags, for adding enctype attributes. Matches the pattern we've used elsewhere. props JustinSainton, fixes #15261. 2013-08-16 19:54:09 +00:00
edit-tags.php Return to 'Item' for term updated messages for the link_category taxonomy. 2013-08-28 18:59:09 +00:00
edit.php Use meta caps edit_post, read_post, and delete_post directly, rather than consulting the post type object. map_meta_cap() handles that for us. props markjaquith, kovshenin. fixes #23226. 2013-07-08 20:05:42 +00:00
export.php Inline documentation for hooks in wp-admin/export.php. 2013-09-14 01:02:10 +00:00
freedoms.php Copy about.php string to freedoms and credits. Update CSS for 3.6 credits. see #24832. 2013-07-31 06:04:41 +00:00
import.php
index.php Short descriptions for inline docs should end with a period, per the vast majority of core. see #25229. 2013-09-06 01:38:09 +00:00
install-helper.php
install.php Remove 'admin' as a fallback for username in install. props tivnet, DrewAPicture. fixes #24078. 2013-08-24 13:57:09 +00:00
link-add.php
link-manager.php
link-parse-opml.php
link.php
load-scripts.php Unique load array in load-scripts and load-styles. 2013-07-29 17:57:04 +00:00
load-styles.php Unique load array in load-scripts and load-styles. 2013-07-29 17:57:04 +00:00
media-new.php
media-upload.php
media.php 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 2013-03-01 16:28:40 +00:00
menu-header.php Remove unused variable. props jeremyfelt. fixes #24959. 2013-08-05 21:38:24 +00:00
menu.php Introduce show_in_menu for register_taxonomy. 2013-08-26 22:35:10 +00:00
moderation.php
ms-admin.php
ms-delete-site.php Inline documentation for hooks in wp-admin/ms-delete-site.php. 2013-09-13 09:11:09 +00:00
ms-edit.php
ms-options.php
ms-sites.php
ms-themes.php
ms-upgrade-network.php
ms-users.php
my-sites.php
nav-menus.php Consolidate similar menu locations strings. props DrewAPicture. fixes #24945. 2013-09-03 01:42:10 +00:00
network.php Avoid scrollbar on network.php's wp-config.php textarea. 2013-07-10 21:57:15 +00:00
options-discussion.php Clarify a string in discussion settings. props Ipstenu, DrewAPicture. fixes #16705. 2013-09-07 15:36:09 +00:00
options-general.php
options-head.php
options-media.php Consistently apply class="title" to our options page h3 tags. 2013-04-16 20:19:29 +00:00
options-permalink.php Fix a grammar error on Permalink Settings screen. props celloexpressions. fixes #25210. 2013-09-02 10:04:10 +00:00
options-reading.php
options-writing.php No space between // and duplicate_hook. see #25229 2013-09-12 18:57:10 +00:00
options.php Inline documentation for hooks in wp-admin/options.php. 2013-09-12 03:44:08 +00:00
plugin-editor.php
plugin-install.php Remove /extend/ from URLs to wordpress.org/plugins, /themes, and /mobile, as those are all now top-level. see #24389. 2013-05-22 21:01:57 +00:00
plugins.php Remove /extend/ from URLs to wordpress.org/plugins, /themes, and /mobile, as those are all now top-level. see #24389. 2013-05-22 21:01:57 +00:00
post-new.php Post locks: load the post locked dialog html in post-new.php too, see #23697. 2013-07-03 01:50:39 +00:00
post.php Use meta caps edit_post, read_post, and delete_post directly, rather than consulting the post type object. map_meta_cap() handles that for us. props markjaquith, kovshenin. fixes #23226. 2013-07-08 20:05:42 +00:00
press-this.php Press This: Add admin_head-like hooks that are specific to the page. 2013-08-26 21:00:09 +00:00
profile.php
revision.php Inline documentation fixes and additions for wp-admin/revision.php and wp-admin/includes/revision.php. 2013-09-12 22:59:08 +00:00
setup-config.php Fix wp_guess_url() to work in every scenario I could find, allows us to use it to determine the correct path to the WordPress Site URL before installation for install.php and setup-config.php redirects. Fixes #24480 Fixes #16884 2013-09-12 06:57:09 +00:00
theme-editor.php Remove redundant context for Child Themes link. fixes #25079. 2013-08-23 00:31:10 +00:00
theme-install.php Remove /extend/ from URLs to wordpress.org/plugins, /themes, and /mobile, as those are all now top-level. see #24389. 2013-05-22 21:01:57 +00:00
themes.php Remove /extend/ from URLs to wordpress.org/plugins, /themes, and /mobile, as those are all now top-level. see #24389. 2013-05-22 21:01:57 +00:00
tools.php
update-core.php Upgrader: Deprecate a few mostly unused functions, wp_update_plugin(), wp_update_theme(), and, wp_update_core(). 2013-09-09 06:45:08 +00:00
update.php More robust escaping in the plugin/theme upgrader. 2013-06-21 05:54:40 +00:00
upgrade-functions.php
upgrade.php
upload.php Use ellipsis instead of three dots. props tjsingleton, jordie23, wojtek.szkutnik, DrewAPicture, SergeyBiryukov. see #8714. 2013-05-08 21:27:31 +00:00
user-edit.php Check $profileuser->rich_editing for empty before using it in Edit User admin code. 2013-09-10 22:49:08 +00:00
user-new.php Bestow sentience upon users. Level up their pronoun. 2013-08-06 16:04:07 +00:00
users.php
widgets.php Avoid 'Only variables should be passed by reference' notice on Widgets screen. props jdgrimes. fixes #25225. 2013-09-04 05:11:09 +00:00