--- rewrite.php.ori	2009-06-16 02:50:56.000000000 +0200
+++ rewrite.php	2009-09-06 12:29:20.671875000 +0200
@@ -1276,6 +1276,8 @@
 			}
 		}
 
+		// Escape dollars in permalinks to avoid possible code injection later
+		$permalink_structure = str_replace('$', '\$', $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])

