Ticket #9640: 9640.2.patch
File 9640.2.patch, 1.1 KB (added by , 16 years ago) |
---|
-
wp-includes/functions.php
1317 1317 * @uses $wpdb Used to sanitize values 1318 1318 * @since 0.71 1319 1319 * 1320 * @param array $array Arrayto used to walk while sanitizing contents.1321 * @return arraySanitized $array.1320 * @param mixed $array Array or else to used to walk while sanitizing contents. 1321 * @return mixed Sanitized $array. 1322 1322 */ 1323 1323 function add_magic_quotes( $array ) { 1324 1324 global $wpdb; 1325 1326 foreach ( (array) $array as $k => $v) {1327 if ( is_array( $v )) {1325 1326 if ( is_array($array) ) { 1327 foreach ( $array as $k => $v ) { 1328 1328 $array[$k] = add_magic_quotes( $v ); 1329 } else {1330 $array[$k] = $wpdb->escape( $v );1331 1329 } 1332 } 1330 } elseif ( is_object($array) ) { 1331 $array = add_magic_quotes( get_object_vars( $array ) ); 1332 } elseif ( is_string($array) ) { 1333 $array = $wpdb->escape( $array ); 1334 } 1335 // no need to handle other types (float, bool, callback, resource.) 1336 1333 1337 return $array; 1334 1338 } 1335 1339