Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 4881)
+++ wp-includes/query.php	(working copy)
@@ -747,6 +747,7 @@
 		}
 
 		// If a search pattern is specified, load the posts that match
+		$q['s'] = trim($q['s']);
 		if (!empty($q['s'])) {
 			// added slashes screw with quote grouping when done early, so done later
 			$q['s'] = stripslashes($q['s']);

