### Eclipse Workspace Patch 1.0
#P wordpress
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 11116)
+++ wp-includes/functions.php	(working copy)
@@ -1315,19 +1315,21 @@
  * @uses $wpdb Used to sanitize values
  * @since 0.71
  *
- * @param array $array Array to used to walk while sanitizing contents.
- * @return array Sanitized $array.
+ * @param  mixed $array Array or else to used to walk while sanitizing contents.
+ * @return mixed Sanitized $array.
  */
 function add_magic_quotes( $array ) {
 	global $wpdb;
-
-	foreach ( (array) $array as $k => $v ) {
-		if ( is_array( $v ) ) {
+	
+	if ( is_array($array) ) {
+		foreach ( $array as $k => $v ) {
 			$array[$k] = add_magic_quotes( $v );
-		} else {
-			$array[$k] = $wpdb->escape( $v );
-		}
-	}
+		}	
+	} elseif ( is_string($array) ) {
+		$array = $wpdb->escape( $array ); 						
+	} 
+	// no need to handle other types (float, bool, callback, resource, object etc.)
+	
 	return $array;
 }
 
