Kaynağa Gözat

Fix: escaping problem

Sotaro KARASAWA 9 yıl önce
ebeveyn
işleme
c5df652054
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      resource/js/crowi.js

+ 2 - 1
resource/js/crowi.js

@@ -346,7 +346,8 @@ $(function() {
     var escape = function(s) {
     var escape = function(s) {
       return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
       return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
     };
     };
-    var pattern = escape(shortPath) + '(/)?$';
+    path = Crowi.escape(path);
+    var pattern = escape(Crowi.escape(shortPath)) + '(/)?$';
 
 
     $link.html(path.replace(new RegExp(pattern), '<strong>' + shortPath + '$1</strong>'));
     $link.html(path.replace(new RegExp(pattern), '<strong>' + shortPath + '$1</strong>'));
   });
   });