WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #48605


Ignore:
Timestamp:
11/14/2019 10:07:56 AM (2 years ago)
Author:
SergeyBiryukov
Comment:

Related: #18322, #21767, #47663.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #48605 – Description

    initial v1  
    33wp_magic_quotes() applies add_magic_quotes() to a wide variety of globals, including $_SERVER. Unfortunately, add_magic_quotes() indiscriminately calls addslashes() on ''every single non-array value'', effectively recasting integers to strings.
    44
    5 For instance, $_SERVER['REQUEST_TIME'], which is a unix timestamp, gets recast to a string of numbers, breaking downstream functionality (like PhpUnit) that expects the timestamp to actually be a timestamp.
     5For instance, `$_SERVER['REQUEST_TIME']`, which is a unix timestamp, gets recast to a string of numbers, breaking downstream functionality (like PhpUnit) that expects the timestamp to actually be a timestamp.
    66
    77add_magic_quotes() needs to be updated to only apply addslashes() when the type of the value is already a string.