Opened 9 years ago
Closed 9 years ago
#37768 closed defect (bug) (fixed)
HTTP API No Longer Accepts Integer and Float Values for the 'cookies' Argument since v4.6
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6.1 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | HTTP API | Keywords: | has-patch has-unit-tests fixed-major |
Focuses: | Cc: |
Description
It seems integer and float values set to the cookies
argument of wp_remote_get()
and wp_remote_post()
get lost with v4.6.
wp_remote_get(
$request_url,
array(
'timeout' => 0.01,
'blocking' => false,
'cookies' => array(
'x' => 'foo', // Okay
'y' => 2, // disappears
'z' => 0.45', // disappears
),
)
);
Attachments (1)
Change History (11)
#1
@
9 years ago
- Summary changed from HTTP API No Longer Accepts Integer and Float Values since v4.6 to HTTP API No Longer Accepts Integer and Float Values for the 'cookies' Argument since v4.6
This ticket was mentioned in Slack in #core by jeremyfelt. View the logs.
9 years ago
#6
in reply to:
↑ 3
@
9 years ago
Replying to swissspidy:
@miunosoft Is
'z' => 0.45'
simply a typo when posting here in trac?
@swissspidy Indeed, that was a typo. Sorry.
#7
@
9 years ago
- Keywords has-patch has-unit-tests added
WP_Http::normalize_cookies()
only checks for values that are instances of WP_Http_Cookie
and strings. Any other scalar value gets ignored. That method was introduced in 4.6 so something definitely changed there.
37768.diff changes this by casting scalars to strings.
@dd32 @rmccue As I am not that familiar with the HTTP API, I'd love to hear your opinion on this.
Note: See
TracTickets for help on using
tickets.
@miunosoft Is
'z' => 0.45'
simply a typo when posting here in trac?