瀏覽代碼

Better fix for </script> in JSON bug

Gaël Métais 10 年之前
父節點
當前提交
8ecfcee83c
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      app/node_controllers/resultsController.js

+ 1 - 2
app/node_controllers/resultsController.js

@@ -36,8 +36,7 @@ var resultsController = function(req, res, googleAnalyticsId) {
 
         // Escape "</script>" because it can interfer with the HTML parser
         var phantomasResults = results.phantomasResults;
-        phantomasResults = phantomasResults.replace('</script>', '\\u003c/script>');
-
+        phantomasResults = phantomasResults.replace(/<\/script>/g, '\\u003c/script>');
 
         var html = results.htmlTemplate;
         html = html.replace('%%METADATA%%', results.phantomasMetadata);