Make WordPress Core

Changeset 47370


Ignore:
Timestamp:
02/25/2020 06:31:33 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Bootstrap/Load: In wp_magic_quotes(), revert the type change to string for REQUEST_TIME and REQUEST_TIME_FLOAT values, which should retain their proper type.

Among other things, this preserves compatibility of WP with PHPUnit Code Coverage generation.

Props jrf, Veraxus, Rarst.
See #48605.

File:
1 edited

Legend:

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

    r47198 r47370  
    930930    $_SERVER = add_magic_quotes( $_SERVER );
    931931
     932    /*
     933     * Revert the type change to string for two indexes which should retain their proper type.
     934     * Among other things, this preserves compatibility of WP with PHPUnit Code Coverage generation.
     935     */
     936    if ( isset( $_SERVER['REQUEST_TIME'] ) ) {
     937        $_SERVER['REQUEST_TIME'] = (int) $_SERVER['REQUEST_TIME'];
     938    }
     939
     940    if ( isset( $_SERVER['REQUEST_TIME_FLOAT'] ) ) {
     941        $_SERVER['REQUEST_TIME_FLOAT'] = (float) $_SERVER['REQUEST_TIME_FLOAT'];
     942    }
     943
    932944    // Force REQUEST to be GET + POST.
    933945    $_REQUEST = array_merge( $_GET, $_POST );
Note: See TracChangeset for help on using the changeset viewer.