#26218 closed defect (bug) (fixed)
add_query_arg() being called incorrectly in ~/wp-includes/cron.php (Version 3.8-beta-1)
| Reported by: | datafeedr.com | Owned by: | ocean90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.8 |
| Component: | Cron API | Version: | 3.8 |
| Severity: | major | Keywords: | has-patch commit |
| Cc: | Focuses: |
Description
On line 275 in ~/wp-includes/cron.php an array() is being passed to the add_query_arg() function:
'url' => add_query_arg( array( 'doing_wp_cron', $doing_wp_cron ), site_url( 'wp-cron.php' ) ),
This is producing a URL where the array indexes 0 and 1 are being used as keys. The URL looks like this:
site.com/wp-cron.php?0=doing_wp_cron&1=1385316015.1194360256195068359375
However the URL should be formatted like this:
site.com/wp-cron.php?doing_wp_cron=1385316015.1194360256195068359375
Therefore the above line should be changed to:
'url' => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ),
This will format the URL being passed to wp-cron.php properly and allow the cron to run.
Eric
Attachments (1)
Change History (8)
#2
@
13 years ago
- Keywords commit added; 2nd-opinion dev-feedback removed
- Milestone Awaiting Review → 3.8
Thanks for the report. It should be array( 'doing_wp_cron' => $doing_wp_cron ), but I'm fine with 26218.patch.
#3
follow-up:
↓ 5
@
13 years ago
Out of curiosity, why it should be array? In the same file we have add_query_arg( 'doing_wp_cron', $doing_wp_cron, wp_unslash( $_SERVER['REQUEST_URI'] ) ) and I did a quick search in core and it looks we are using this form when there is only one key.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
For the record, this started with [26267], see ticket:25475#comment:6