mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 05:51:03 +08:00
SECURITY: Malformed URL could crash V8
This commit is contained in:
parent
2c6d03f87f
commit
1e880fd5e1
12
vendor/assets/javascripts/better_markdown.js
vendored
12
vendor/assets/javascripts/better_markdown.js
vendored
|
@ -1349,11 +1349,13 @@
|
||||||
return [ consumed, link ];
|
return [ consumed, link ];
|
||||||
}
|
}
|
||||||
|
|
||||||
m = text.match(new RegExp("^\\((" + urlRegexp + ")\\)"));
|
if (text.indexOf('(') === 0 && text.indexOf(')') !== -1) {
|
||||||
if (m && m[1]) {
|
m = text.match(new RegExp("^\\((" + urlRegexp + ")\\)"));
|
||||||
consumed += m[0].length;
|
if (m && m[1]) {
|
||||||
link = ["link", {href: m[1]}].concat(children);
|
consumed += m[0].length;
|
||||||
return [consumed, link];
|
link = ["link", {href: m[1]}].concat(children);
|
||||||
|
return [consumed, link];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Alt text][id]
|
// [Alt text][id]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user