You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1af116d
Browse filesBrowse the repository at this point in the historyBrowse files
A cookie created without a name, value, domain, expiration or host-only flag, or from incomplete data, leaves those properties `null`, and an unparsable expiration date is stored as `false`, but their documented types said otherwise. PHPStan therefore treated `isset()` checks on them as always true, so correcting the types retires the `booleanOr.alwaysFalse` baseline entirely along with several `isset.property` entries.
The corrected types surfaced real errors in callers, which are fixed rather than baselined:
* In `WP_Http::normalize_cookies()`, a `WP_Http_Cookie` value was passed to `WpOrg\Requests\Cookie` as is, which throws an `InvalidArgument` exception for anything but a string, failing the request. A cookie without a value or with a non-scalar value is now skipped, as `WP_Http_Cookie::getHeaderValue()` already does, and other scalar values are cast to strings.
* `wp_remote_retrieve_cookie_value()` now returns an empty string instead of `null` for a cookie without a value.
The handling of empty or missing cookie names is unchanged, as it is being addressed separately in #66305.
Developed in #14283.
Follow-up to r38164, r45135, r57501, r63023.
Props huzaifaalmesbah, westonruter.
See #65817, #66305.
git-svn-id: https://develop.svn.wordpress.org/trunk@64350 602fd350-edb4-49c9-b593-d223f7449a82
0 commit comments