This commit is contained in:
JC Brand 2018-10-07 05:05:29 +02:00
parent 6a5a502d58
commit b039398a73
3 changed files with 3 additions and 12 deletions

View File

@ -7,6 +7,7 @@
- #1063 URLs in the topic / subject are not clickable - #1063 URLs in the topic / subject are not clickable
- #1190 MUC Participants column disappears in certain viewport widths - #1190 MUC Participants column disappears in certain viewport widths
- #1199 Can't get back from to login screen from registration screen - #1199 Can't get back from to login screen from registration screen
- #1204 Link encoding issue
- #1214 Setting `allow_contact_requests` to `false` has no effect - #1214 Setting `allow_contact_requests` to `false` has no effect
- #1222 Adding a bookmark should prefill the room name - #1222 Adding a bookmark should prefill the room name

7
dist/converse.js vendored
View File

@ -81570,10 +81570,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return string.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"); return string.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
}; };
u.escapeURL = function (url) {
return encodeURI(decodeURI(url)).replace(/[!'()]/g, escape).replace(/\*/g, "%2A");
};
u.prefixMentions = function (message) { u.prefixMentions = function (message) {
/* Given a message object, return its text with @ chars /* Given a message object, return its text with @ chars
* inserted before the mentioned nicknames. * inserted before the mentioned nicknames.
@ -81607,14 +81603,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
u.addHyperlinks = function (text) { u.addHyperlinks = function (text) {
return URI.withinString(text, url => { return URI.withinString(text, url => {
const uri = new URI(url); const uri = new URI(url);
uri.normalize(); url = uri.normalize()._string;
const pretty_url = uri._parts.urn ? url : uri.readable(); const pretty_url = uri._parts.urn ? url : uri.readable();
if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) { if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) {
url = 'http://' + url; url = 'http://' + url;
} }
url = u.escapeHTML(u.escapeURL(url));
return `<a target="_blank" rel="noopener" href="${url}">${u.escapeHTML(pretty_url)}</a>`; return `<a target="_blank" rel="noopener" href="${url}">${u.escapeHTML(pretty_url)}</a>`;
}, { }, {
'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi 'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi

View File

@ -228,10 +228,6 @@
.replace(/"/g, "&quot;"); .replace(/"/g, "&quot;");
}; };
u.escapeURL = function (url) {
return encodeURI(decodeURI(url)).replace(/[!'()]/g, escape).replace(/\*/g, "%2A");
};
u.prefixMentions = function (message) { u.prefixMentions = function (message) {
/* Given a message object, return its text with @ chars /* Given a message object, return its text with @ chars
* inserted before the mentioned nicknames. * inserted before the mentioned nicknames.
@ -267,12 +263,11 @@
u.addHyperlinks = function (text) { u.addHyperlinks = function (text) {
return URI.withinString(text, url => { return URI.withinString(text, url => {
const uri = new URI(url); const uri = new URI(url);
uri.normalize(); url = uri.normalize()._string;
const pretty_url = uri._parts.urn ? url : uri.readable(); const pretty_url = uri._parts.urn ? url : uri.readable();
if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) { if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) {
url = 'http://' + url; url = 'http://' + url;
} }
url = u.escapeHTML(u.escapeURL(url));
return `<a target="_blank" rel="noopener" href="${url}">${u.escapeHTML(pretty_url)}</a>`; return `<a target="_blank" rel="noopener" href="${url}">${u.escapeHTML(pretty_url)}</a>`;
}, { }, {
'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi 'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi