Index: bueditor.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bueditor/bueditor.module,v
retrieving revision 1.12.2.2
diff -u -r1.12.2.2 bueditor.module
--- bueditor.module	20 Dec 2007 18:13:06 -0000	1.12.2.2
+++ bueditor.module	14 Jun 2009 21:42:15 -0000
@@ -598,7 +598,7 @@
  * Check matching lines of the needle in haystack.(page and textarea id)
  */
 function bueditor_check_match($needle, $haystack) {
-  $needle = '/^'. preg_replace("/\r\n?|\n/", '|', str_replace(array('*', '-', '/'), array('.*', '\\-', '\\/'), $needle)) .'$/';
+  $needle = '/^'. preg_replace("/\r\n?|\n/", '|', str_replace(array('*', '-', '/'), array('.*', '\\-', '\\/'), trim($needle))) .'$/';
   return preg_match($needle, $haystack);
 }
 

