Changeset 2700

Show
Ignore:
Timestamp:
07/06/05 01:12:38 (3 years ago)
Author:
ryan
Message:

Stripslashes doesn't work on arrays. Add stripslashes_deep(). Props: Mike Little

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/functions-formatting.php

    r2699 r2700  
    531531 
    532532    return $wpdb->escape($gpc); 
     533} 
     534 
     535 
     536function stripslashes_deep($value) 
     537{ 
     538   $value = is_array($value) ? 
     539               array_map('stripslashes_deep', $value) : 
     540               stripslashes($value); 
     541 
     542   return $value; 
    533543} 
    534544 
  • trunk/wp-settings.php

    r2699 r2700  
    139139// If already slashed, strip. 
    140140if ( get_magic_quotes_gpc() ) { 
    141     $_GET    = stripslashes($_GET   ); 
    142     $_POST   = stripslashes($_POST  ); 
    143     $_COOKIE = stripslashes($_COOKIE); 
    144     $_SERVER = stripslashes($_SERVER); 
     141    $_GET    = stripslashes_deep($_GET   ); 
     142    $_POST   = stripslashes_deep($_POST  ); 
     143    $_COOKIE = stripslashes_deep($_COOKIE); 
     144    $_SERVER = stripslashes_deep($_SERVER); 
    145145} 
    146146