Browse Source

Better fix for </script> in JSON bug

Gaël Métais 10 years ago
parent
commit
8ecfcee83c
1 changed files with 1 additions and 2 deletions
  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
         // Escape "</script>" because it can interfer with the HTML parser
         var phantomasResults = results.phantomasResults;
         var phantomasResults = results.phantomasResults;
-        phantomasResults = phantomasResults.replace('</script>', '\\u003c/script>');
-
+        phantomasResults = phantomasResults.replace(/<\/script>/g, '\\u003c/script>');
 
 
         var html = results.htmlTemplate;
         var html = results.htmlTemplate;
         html = html.replace('%%METADATA%%', results.phantomasMetadata);
         html = html.replace('%%METADATA%%', results.phantomasMetadata);