Plugin Directory

Changeset 2674872

Timestamp:
02/08/2022 10:04:01 AM (3 years ago)
Author:
kovshenin
Message:

Add 1.0.3 to trunk

Location:
surge/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • surge/trunk/include/cache.php

    r2656415 r2674872  
    3131    foreach ( headers_list() as $header ) {
    3232        list( $name, $value ) = array_map( 'trim', explode( ':', $header, 2 ) );
    33         $headers[ $name ] = $value;
     33
     34        // Do not store or vary on these headers.
     35        if ( in_array( strtolower( $name ), ['x-cache', 'x-powered-by'] ) ) {
     36            continue;
     37        }
     38
     39        $headers[ $name ][] = $value;
    3440
    3541        if ( strtolower( $name ) == 'set-cookie' ) {
  • surge/trunk/include/common.php

    r2656415 r2674872  
    8080    $path = $parsed['path'];
    8181    $query = $parsed['query'] ?? '';
    82     parse_str( $query, $query_vars );
     82    $query_vars = [];
     83
     84    // Simplified parse_str without urldecoding
     85    foreach ( explode( '&', $query ) as $pair ) {
     86        $parts = explode( '=', $pair, 2 );
     87        $key = $parts[0];
     88        $value = $parts[1] ?? '';
     89
     90        if ( ! array_key_exists( $key, $query_vars ) ) {
     91            $query_vars[ $key ] = $value;
     92        } else {
     93            if ( ! is_array( $query_vars[ $key ] ) ) {
     94                $query_vars[ $key ] = [ $query_vars[ $key ] ];
     95            }
     96            $query_vars[ $key ][] = $value;
     97        }
     98    }
    8399
    84100    // Ignore some query vars.
  • surge/trunk/include/invalidate.php

    r2656448 r2674872  
    115115        'update_option_page_on_front',
    116116        'update_option_page_for_posts',
     117
    117118        'update_option_woocommerce_permalinks',
    118119        'automatic_updates_complete',
  • surge/trunk/include/serve.php

    r2640447 r2674872  
    7474http_response_code( $meta['code'] );
    7575
    76 foreach ( $meta['headers'] as $name => $value ) {
    77     header( "{$name}: {$value}" );
     76foreach ( $meta['headers'] as $name => $values ) {
     77    foreach( (array) $values as $value ) {
     78        header( "{$name}: {$value}", false );
     79    }
    7880}
    7981
  • surge/trunk/readme.txt

    r2656415 r2674872  
    66Tested up to: 5.9
    77Requires PHP: 7.3
    8 Stable tag: 1.0.2
     8Stable tag: 1.0.
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    6363== Changelog ==
    6464
     65
     66
     67
     68
     69
     70
    6571= 1.0.2 =
    6672* Fix PHP notice in invalidation
  • surge/trunk/surge.php

    r2656415 r2674872  
    88 * Text Domain: surge
    99 * Domain Path: /languages
    10  * Version: 1.0.2
     10 * Version: 1.0.
    1111 *
    1212 * @package Surge
Note: See TracChangeset for help on using the changeset viewer.