WordPress/wp-admin/includes
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
..
admin.php Load the new admin and network admin mo files, if present. see #19852 2012-01-27 22:19:56 +00:00
ajax-actions.php Fix several esoteric errors related to AJAX unit tests for comments: 2013-09-14 18:36:09 +00:00
bookmark.php Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes(). 2013-03-01 17:00:25 +00:00
class-ftp-pure.php "LGPL License" is redundant. 2013-02-15 16:26:46 +00:00
class-ftp-sockets.php "LGPL License" is redundant. 2013-02-15 16:26:46 +00:00
class-ftp.php "LGPL License" is redundant. 2013-02-15 16:26:46 +00:00
class-pclzip.php Associate subdirector of whitespace trims trailing whites with pinking shears. 2009-10-15 20:26:21 +00:00
class-wp-comments-list-table.php Remove obsolete translator comment. props zeo. fixes #24464. 2013-06-23 08:30:30 +00:00
class-wp-filesystem-base.php WP_Filesystem: Let the code breathe, add some additional whitespace between method definitions and comments. 2013-09-09 02:55:09 +00:00
class-wp-filesystem-direct.php Make use of the mbstring.func_overload helper functions in WP_Filesystem so byte lengths are properly determined. See #25259 Fixes #25237 2013-09-11 08:27:10 +00:00
class-wp-filesystem-ftpext.php Make use of the mbstring.func_overload helper functions in WP_Filesystem so byte lengths are properly determined. See #25259 Fixes #25237 2013-09-11 08:27:10 +00:00
class-wp-filesystem-ftpsockets.php Make use of the mbstring.func_overload helper functions in WP_Filesystem so byte lengths are properly determined. See #25259 Fixes #25237 2013-09-11 08:27:10 +00:00
class-wp-filesystem-ssh2.php WP_Filesyste: SSH2 PHP Extension support: Fix a case where defining a custom FS_CHMOD_FILE / FS_CHMOD_DIR constant wouldn't take effect due to chmod() failing with a invalid path. Fixes #23589 2013-09-09 03:05:09 +00:00
class-wp-importer.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
class-wp-links-list-table.php Remove unused variables reset by wp_reset_vars(). Many of these haven't been used since b2. see #21767. 2013-02-16 18:28:41 +00:00
class-wp-list-table.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
class-wp-media-list-table.php Don't create an edit link to a non-UI post type in the media list table. 2013-08-27 20:49:10 +00:00
class-wp-ms-sites-list-table.php Network Admin: Hide the bulk actions checkbox for the main site. 2013-08-26 18:46:08 +00:00
class-wp-ms-themes-list-table.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
class-wp-ms-users-list-table.php Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes(). 2013-03-01 17:00:25 +00:00
class-wp-plugin-install-list-table.php Add a filter on the Plugin and Theme installers table listing API args, this allows for plugins to hook in and add custom args to plugins_api() and themes_api() for the Plugin/Theme listing tabls. Fixes #18169 2013-08-21 06:52:12 +00:00
class-wp-plugins-list-table.php Avoid a PHP warning in network admin if a constant corresponding to a drop-in is not defined. fixes #25301. 2013-09-13 09:37:10 +00:00
class-wp-posts-list-table.php Add data types to @param documentation for the _page_rows() method of the posts list table. props c3mdigital, fixes #24872. 2013-08-05 22:10:03 +00:00
class-wp-terms-list-table.php Terms list table: Only show 'View' links for public taxonomies. props SergeyBiryukov. fixes #24692. 2013-07-28 21:06:19 +00:00
class-wp-theme-install-list-table.php Add a filter on the Plugin and Theme installers table listing API args, this allows for plugins to hook in and add custom args to plugins_api() and themes_api() for the Plugin/Theme listing tabls. Fixes #18169 2013-08-21 06:52:12 +00:00
class-wp-themes-list-table.php Fix invalid markup when searching for installed themes. fixes #25288. 2013-09-12 00:03:10 +00:00
class-wp-upgrader-skins.php WordPress Core Automatic Updates: Pass the Filesystem path as $context to request_filesystem_credentials(). See #22704 2013-09-13 06:53:09 +00:00
class-wp-upgrader.php Upgrader: Allow plugins to short-circuit the package download. Props rmccue and DrewAPicture. Fixes #22378 2013-09-13 12:53:08 +00:00
class-wp-users-list-table.php Remove redundant echo calls from list tables. Don't mix string concatenation with direct output. see #24210. 2013-04-29 01:10:50 +00:00
comment.php Inline documentation for hooks in wp-admin/includes/comment.php. 2013-09-14 01:01:08 +00:00
continents-cities.php Give continents-cities their own textdomain. Props nbachiyski, Denis-de-Bernardy . fixes #9794 2009-05-14 20:05:25 +00:00
dashboard.php Avoid PHP notices when configuring the Incoming Links dashboard widget. fixes #25250. 2013-09-07 18:17:10 +00:00
deprecated.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
export.php Consistently wrap `author` and `excerpt` nodes with `CDATA` in feeds. 2013-09-10 16:55:09 +00:00
file.php Switch unzip_file() over to using the mbstring.func_override helper functions. See #25259 2013-09-11 08:09:08 +00:00
image-edit.php Instead of saying that scaling up images will result in fuzzy images, just say that it's not supported (because it isn't). 2013-07-05 15:45:43 +00:00
image.php Add functions for generating metadata for video and audio, using the 2013-03-21 04:55:42 +00:00
import.php Fix E_STRICT notice in wp_get_popular_importers(). see #24356. 2013-05-28 03:53:59 +00:00
list-table.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
media.php Add file size to attachment publish meta box. props desrosj. fixes #25170. 2013-09-12 15:10:09 +00:00
menu.php Prevent an offset error if the first menu item is a separator. 2013-06-20 16:45:45 +00:00
meta-boxes.php Add more descriptive classes to submit meta box sections. props nofearinc. fixes #22333. 2013-08-22 15:24:10 +00:00
misc.php Move _local_storage_notice() to admin/includes/template.php. props azaozz, see #24756. 2013-07-22 05:09:49 +00:00
ms-deprecated.php Remove ms-files.php rewriting from WordPress multisite. fixes #19235. 2012-09-11 22:22:20 +00:00
ms.php Fix potential SQLi through improper use of API functions. 2013-07-29 18:16:47 +00:00
nav-menu.php Use `get_the_title()` when dealing with `post_type`-like items in the admin. 2013-09-06 17:08:08 +00:00
plugin-install.php Switch to using HTTPS connections for Plugin and Theme API requests when SSL is available. See #18577 2013-09-09 07:54:11 +00:00
plugin.php Upgrader: Make clearing the Plugin and Theme update caches optional during install and upgrade proceedures. See #22704 2013-09-06 01:33:09 +00:00
post.php Ignore user ID post data. 2013-09-10 17:58:09 +00:00
revision.php Better alignment for wp_prepare_revisions_for_js() inline docs. see #25283. 2013-09-12 23:15:10 +00:00
schema.php Clear all transients (regardless of expiration) on all database upgrades. see #20316. 2013-09-12 21:14:10 +00:00
screen.php Remove post format icons next to header on edit post screen. fixes #24502. see #24452. 2013-06-06 14:45:25 +00:00
taxonomy.php Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes(). 2013-03-01 17:00:25 +00:00
template.php Remove unnecessary checks before setting `$wp_settings_*` arrays. Adds unit test for setting a nonexistent variable to a multi-dimensional `array`. 2013-09-04 19:07:09 +00:00
theme-install.php Fix usage of undeclared variables. 2013-05-07 16:35:03 +00:00
theme.php Switch to using HTTPS connections for Plugin and Theme API requests when SSL is available. See #18577 2013-09-09 07:54:11 +00:00
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 WordPress Core Automatic Updates: Add the first slice of Automatic Upgrades, This is presently disabled, and requires a filter to enable ( 'auto_upgrade_core' ). See #22704 2013-09-13 06:19:12 +00:00
upgrade.php Add signup_id primary key to $wpdb->signups, and add better indexes. 2013-08-30 04:30:08 +00:00
user.php Update phpdoc for get_user_to_edit(), get_userdata(), and get_user_by(). props tivnet. fixes #24992. 2013-09-02 03:25:09 +00:00
widgets.php Fix typos in phpdoc. props TheLastCicada. fixes #24302. 2013-05-10 01:39:30 +00:00