WordPress.org

Make WordPress Core

Ticket #51800: 51800.diff

File 51800.diff, 1.5 KB (added by johnbillion, 10 months ago)
  • src/wp-includes/formatting.php

     
    55145514}
    55155515
    55165516/**
    5517  * Add slashes to a string or array of strings, in a recursive manner.
     5517 * Adds slashes to a string or recursively adds slashes to strings within an array.
    55185518 *
    55195519 * This should be used when preparing data for core API that expects slashed data.
    55205520 * This should not be used to escape data going directly into an SQL query.
     
    55225522 * @since 3.6.0
    55235523 * @since 5.5.0 Non-string values are left untouched.
    55245524 *
    5525  * @param string|string[] $value String or array of strings to slash.
    5526  * @return string|string[] Slashed $value.
     5525 * @param string|array $value String or array of data to slash.
     5526 * @return string|array Slashed $value.
    55275527 */
    55285528function wp_slash( $value ) {
    55295529        if ( is_array( $value ) ) {
     
    55385538}
    55395539
    55405540/**
    5541  * Remove slashes from a string or array of strings.
     5541 * Removes slashes from a string or recursively removes slashes from strings within an array.
    55425542 *
    55435543 * This should be used to remove slashes from data passed to core API that
    55445544 * expects data to be unslashed.
    55455545 *
    55465546 * @since 3.6.0
    55475547 *
    5548  * @param string|array $value String or array of strings to unslash.
    5549  * @return string|array Unslashed $value
     5548 * @param string|array $value String or array of data to unslash.
     5549 * @return string|array Unslashed $value.
    55505550 */
    55515551function wp_unslash( $value ) {
    55525552        return stripslashes_deep( $value );