Skip to content

Commit

Permalink
Merge pull request #7538 from satyapramodh/url_parse
Browse files Browse the repository at this point in the history
[FIX] URL parse error fix for issue #7169
  • Loading branch information
rodrigok authored Jul 26, 2017
2 parents d3c2b75 + 42cae84 commit 5fade40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/rocketchat-lib/server/functions/sendMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ RocketChat.sendMessage = function(user, message, room, upsert = false) {
}
}
if (message.parseUrls !== false) {
const urls = message.msg.match(/([A-Za-z]{3,9}):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+=!:~%\/\.@\,\w]*)?\??([-\+=&!:;%@\/\.\,\w]+)?(?:#([^\s\)]+))?)?/g);
const urls = message.msg.match(/([A-Za-z]{3,9}):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+=!:~%\/\.@\,\(\)\w]*)?\??([-\+=&!:;%@\/\.\,\w]+)?(?:#([^\s\)]+))?)?/g);

if (urls) {
message.urls = urls.map(function(url) {
return {
Expand Down

0 comments on commit 5fade40

Please sign in to comment.