Make WordPress Core


Ignore:
Timestamp:
01/31/2024 12:51:39 PM (13 months ago)
Author:
swissspidy
Message:

HTTP API: Ensure cookie names are cast to strings.

Props nosilver4u, darssen, kraftbj, engahmeds3ed, barry.hughes, schlessera.
Fixes #58566.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-http.php

    r56723 r57501  
    468468                    }
    469469                );
    470                 $cookie_jar[ $value->name ] = new WpOrg\Requests\Cookie( $value->name, $value->value, $attributes, array( 'host-only' => $value->host_only ) );
     470                $cookie_jar[ $value->name ] = new WpOrg\Requests\Cookie( (string) $value->name, $value->value, $attributes, array( 'host-only' => $value->host_only ) );
    471471            } elseif ( is_scalar( $value ) ) {
    472                 $cookie_jar[ $name ] = new WpOrg\Requests\Cookie( $name, (string) $value );
     472                $cookie_jar[ $name ] = new WpOrg\Requests\Cookie( (string) $name, (string) $value );
    473473            }
    474474        }
Note: See TracChangeset for help on using the changeset viewer.