Index: wp-includes/rewrite.php
===================================================================
--- wp-includes/rewrite.php	(revision 21220)
+++ wp-includes/rewrite.php	(working copy)
@@ -1251,6 +1251,8 @@
 			}
 		}
 
+		$permalink_structure = preg_quote( $permalink_structure );
+
 		//get everything up to the first rewrite tag
 		$front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
 		//build an array of the tags (note that said array ends up being in $tokens[0])
