Commit Graph

9 Commits

Author SHA1 Message Date
Dominik Schilling (ocean90) 6311fbbfdb Replace use of global `$user_ID` in favor of `get_current_user_id()`. fixes #25372.
git-svn-id: https://develop.svn.wordpress.org/trunk@25669 602fd350-edb4-49c9-b593-d223f7449a82
2013-10-02 21:09:52 +00:00
Drew Jaynes 05ae44eaca Inline documentation for hooks in wp-admin/includes/ajax-actions.php.
Fixes #25374.


git-svn-id: https://develop.svn.wordpress.org/trunk@25558 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-21 20:46:15 +00:00
Andrew Nacin e24a1ac0dc Use get_terms() in the ajax tag search.
props Chouby.
fixes #25231.


git-svn-id: https://develop.svn.wordpress.org/trunk@25452 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-16 17:50:16 +00:00
Scott Taylor 535ae26afd 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@25438 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-14 18:35:43 +00:00
Scott Taylor 402e61f269 Fix some undefined index notices related to Comment unit tests:
* There are several places where a `$_POST` index was unchecked before setting a variable
* In `wp_notify_postauthor()`, `$comment` was being returned null, but its properties were being accessed.
* In `check_ajax_referer()`, 3 different values can be checked for nonce on `$_REQUEST`, but only 1 had an `isset()`

See #25282.



git-svn-id: https://develop.svn.wordpress.org/trunk@25433 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-13 22:17:51 +00:00
Scott Taylor ac23d53402 * Avoid notices in `tests/ajax/Autosave` by bailing early when `get_post()` returns nothing.
* Check for the existence of `$_POST['catslist']` before using it in `wp_ajax_autosave()`.

See #25282.



git-svn-id: https://develop.svn.wordpress.org/trunk@25430 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-13 21:21:16 +00:00
Andrew Nacin 69a949d160 Add new ajax_query_attachments_args filter.
props alex-ye.
fixes #24285.


git-svn-id: https://develop.svn.wordpress.org/trunk@25279 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-06 15:17:35 +00:00
Dion Hulse b971127bac Remove the usage of @$_GET and @$_POST and just check to see if the indicies are set. Fixes #22429
git-svn-id: https://develop.svn.wordpress.org/trunk@25025 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-15 06:05:54 +00:00
Andrew Nacin b43712e0f7 New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory.
 * New task runner (Grunt), configured to copy a built WordPress to build/.
 * svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
 * Remove Akismet external from develop.svn. Still exists in core.svn.
 * Drop minified files from src/. The build process will now generate these.

props koop.
see #24976.

and see http://wp.me/p2AvED-1AI.



git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-07 05:25:25 +00:00