Opened 10 years ago
Closed 10 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: | miunosoft | Owned by: | swissspidy |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.6.1 |
| Component: | HTTP API | Version: | 4.6 |
| Severity: | normal | Keywords: | has-patch has-unit-tests fixed-major |
| Cc: | Focuses: |
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
@
10 years ago
- Summary HTTP API No Longer Accepts Integer and Float Values since v4.6 → 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.
10 years ago
#6
in reply to: ↑ 3
@
10 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
@
10 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
@miunosoft Is
'z' => 0.45'simply a typo when posting here in trac?