### Eclipse Workspace Patch 1.0
#P wordpress-trunk
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 12681)
+++ wp-includes/functions.php	(working copy)
@@ -238,36 +238,40 @@
  *
  * If $data is not an string, then returned value will always be false.
  * Serialized data is always a string.
+ * 
+ * NOTICE: There can be no guarantee wether the data passed was not
+ * just a string even if it looked like it was serialized.
  *
  * @since 2.0.5
  *
  * @param mixed $data Value to check to see if was serialized.
  * @return bool False if not serialized and true if it was.
  */
-function is_serialized( $data ) {
-	// if it isn't a string, it isn't serialized
+function is_serialized( &$data ) {
 	if ( !is_string( $data ) )
 		return false;
-	$data = trim( $data );
-	if ( 'N;' == $data )
-		return true;
-	if ( !preg_match( '/^([adObis]):/', $data, $badions ) )
+
+	if ( !preg_match( '/^([abdiOs]:|N;)/', $data, $matches ) )
 		return false;
-	switch ( $badions[1] ) {
-		case 'a' :
-		case 'O' :
-		case 's' :
-			if ( preg_match( "/^{$badions[1]}:[0-9]+:.*[;}]\$/s", $data ) )
-				return true;
-			break;
-		case 'b' :
-		case 'i' :
-		case 'd' :
-			if ( preg_match( "/^{$badions[1]}:[0-9.E-]+;\$/", $data ) )
-				return true;
-			break;
+		
+	$type = $matches[1][0];
+		
+	switch ( $type ) {
+		case 'a' : # array
+			return (bool) preg_match( '/^a:[0-9]+:{.*}$/s', $data );
+		case 'b' : # bool
+		case 'd' : # double	
+		case 'i' : # integer
+			return (bool) preg_match( "/^{$type}:[0-9.E-]+;\$/", $data );
+		case 'N' : # NULL
+			return (bool) ( 'N;' == $data );
+		case 'O' : # object
+			return (bool) preg_match( '/^O:[0-9]+:"[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*":[0-9]+:{.*}$/s', $data ); 
+		case 's' : # string
+			return (bool) preg_match( '/^s:[0-9]+:".*";$/s', $data );
+		default:
+			return false;
 	}
-	return false;
 }
 
 /**
