WordPress.org

Make WordPress Core

Ticket #18026: 18026.diff

File 18026.diff, 738 bytes (added by kawauso, 7 years ago)

is_string() on stripslashes()

  • wp-includes/formatting.php

     
    12271227 *
    12281228 * @since 2.0.0
    12291229 *
    1230  * @param array|string $value The array or string to be stripped.
    1231  * @return array|string Stripped array (or string in the callback).
     1230 * @param mixed $value The value to be stripped.
     1231 * @return mixed Stripped value.
    12321232 */
    12331233function stripslashes_deep($value) {
    12341234        if ( is_array($value) ) {
     
    12381238                foreach ($vars as $key=>$data) {
    12391239                        $value->{$key} = stripslashes_deep( $data );
    12401240                }
    1241         } else {
     1241        } elseif ( is_string($value) ) {
    12421242                $value = stripslashes($value);
    12431243        }
    12441244