Make WordPress Core


Ignore:
Timestamp:
05/20/2010 09:16:44 PM (14 years ago)
Author:
westi
Message:

Attempt to make stripslashes_deep object safe. See #12860

File:
1 edited

Legend:

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

    r14487 r14766  
    12271227 */
    12281228function stripslashes_deep($value) {
    1229     $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
     1229    if ( is_array($value) ) {
     1230        $value = array_map('stripslashes_deep', $value);
     1231    } elseif ( is_object($value) ) {
     1232        $vars = get_object_vars( $value );
     1233        foreach ($vars as $key=>$data) {
     1234            $value->{$key} = stripslashes_deep( $data );
     1235        }
     1236    } else {
     1237        $value = stripslashes($value);
     1238    }
     1239
    12301240    return $value;
    12311241}
Note: See TracChangeset for help on using the changeset viewer.