Make WordPress Core

Changeset 57501

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

HTTP API: Ensure cookie names are cast to strings.

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

Location:
trunk
Files:
2 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( $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( $name, (string) $value );
    473473            }
    474474        }
  • trunk/tests/phpunit/tests/http/http.php

    r56559 r57501  
    662662        $this->assertTrue( $pre_http_request_filter_has_run, 'The pre_http_request filter is expected to run.' );
    663663    }
     664
     665
     666
     667
     668
     669
     670
     671
     672
     673
     674
     675
     676
     677
     678
     679
     680
     681
     682
     683
     684
     685
     686
     687
     688
     689
     690
     691
     692
     693
     694
     695
     696
     697
     698
     699
     700
     701
     702
     703
     704
     705
     706
     707
     708
     709
     710
     711
     712
     713
     714
     715
    664716}
Note: See TracChangeset for help on using the changeset viewer.