#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 |
---|---|---|---|
Milestone: | 3.8 | Priority: | normal |
Severity: | major | Version: | 3.8 |
Component: | Cron API | Keywords: | has-patch commit |
Focuses: | Cc: |
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
@
11 years ago
- Keywords commit added; 2nd-opinion dev-feedback removed
- Milestone changed from Awaiting Review to 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
@
11 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.
#4
@
11 years ago
- Owner set to ocean90
- Resolution set to fixed
- Status changed from new to closed
In 26365:
For the record, this started with [26267], see ticket:25475#comment:6