ソースを参照

Fix: escaping problem

Sotaro KARASAWA 9 年 前
コミット
c5df652054
1 ファイル変更2 行追加1 行削除
  1. 2 1
      resource/js/crowi.js

+ 2 - 1
resource/js/crowi.js

@@ -346,7 +346,8 @@ $(function() {
     var escape = function(s) {
       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>'));
   });