Skip to content

Commit a31f8d0

Browse files
authored
Merge pull request #337 from canjs/336-fix-runaway-regexp
Fix catastrophic backtracking ReqExp. Closes #336
2 parents 1c5279d + a6ee6ad commit a31f8d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

static/canjs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function navigate(href) {
194194
ga('send', 'pageview', window.location.pathname);
195195

196196
// set new content
197-
var $content = $(content.match(/<body>(\r|\n|.)+<\/body>/g)[0]);
197+
var $content = $(content.match(/<body.*?>[\s\S]+<\/body>/g)[0]);
198198
if (!$content.length) {
199199
window.location.reload();
200200
}

0 commit comments

Comments
 (0)