[Svn] r3704 - trunk/roundcubemail/program/js

trac at roundcube.net trac at roundcube.net
Thu Jun 3 10:21:49 CEST 2010


Author: alec
Date: 2010-06-03 03:21:43 -0500 (Thu, 03 Jun 2010)
New Revision: 3704

Modified:
   trunk/roundcubemail/program/js/app.js
Log:
- Fix autocomplete results are wrongly displayed when search string contains e.g. a dot character


Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2010-06-03 08:11:42 UTC (rev 3703)
+++ trunk/roundcubemail/program/js/app.js	2010-06-03 08:21:43 UTC (rev 3704)
@@ -3476,7 +3476,7 @@
       for (i=0; i < a_results.length; i++) {
         text = typeof a_results[i] == 'object' ? a_results[i].name : a_results[i];
         li = document.createElement('LI');
-        li.innerHTML = text.replace(new RegExp('('+s_val+')', 'ig'), '##$1%%').replace(/</g, '<').replace(/>/g, '>').replace(/##([^%]+)%%/g, '<b>$1</b>');
+        li.innerHTML = text.replace(new RegExp('('+RegExp.escape(s_val)+')', 'ig'), '##$1%%').replace(/</g, '<').replace(/>/g, '>').replace(/##([^%]+)%%/g, '<b>$1</b>');
         li.onmouseover = function(){ ref.ksearch_select(this); };
         li.onmouseup = function(){ ref.ksearch_click(this) };
         li._rcm_id = i;

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list