WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/13/2019 10:19:34 PM (3 months ago)
Author:
jorbin
Message:

GENERAL: Remove magic quote functions

The path to magic quote sanity took a fun and exciting turn: PHP core removed it and WordPress updated the minimum version.

For the formally external pclzip, the code is commented out to make investigating easier and in case we ever need to merge upstream (if that still exists) changes.

Props ayeshrajans, jrf, jorbin.
See #47783.
Fixes #18322.

File:
1 edited

Legend:

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

    r45990 r46105  
    27142714 */
    27152715function addslashes_gpc( $gpc ) {
    2716     if ( get_magic_quotes_gpc() ) {
    2717         $gpc = stripslashes( $gpc );
    2718     }
    2719 
    27202716    return wp_slash( $gpc );
    27212717}
     
    47834779 * Parses a string into variables to be stored in an array.
    47844780 *
    4785  * Uses {@link https://secure.php.net/parse_str parse_str()} and stripslashes if
    4786  * {@link https://secure.php.net/magic_quotes magic_quotes_gpc} is on.
    47874781 *
    47884782 * @since 2.2.1
     
    47934787function wp_parse_str( $string, &$array ) {
    47944788    parse_str( $string, $array );
    4795     if ( get_magic_quotes_gpc() ) {
    4796         $array = stripslashes_deep( $array );
    4797     }
     4789
    47984790    /**
    47994791     * Filters the array of variables derived from a parsed string.
Note: See TracChangeset for help on using the changeset viewer.