Allow unsafe urls (maybe this is unsafe)

This commit is contained in:
morethanwords 2020-10-16 23:22:41 +03:00
parent ee4d05c9e5
commit 69caa741e5
2 changed files with 3 additions and 3 deletions

View File

@ -2404,7 +2404,7 @@ export class AppMessagesManager {
apiMessage.rReply = this.getRichReplyText(apiMessage);
if(apiMessage.message && apiMessage.message.length) {
if(apiMessage.message && apiMessage.message.length && !apiMessage.totalEntities) {
const myEntities = RichTextProcessor.parseEntities(apiMessage.message);
const apiEntities = apiMessage.entities || [];
apiMessage.totalEntities = RichTextProcessor.mergeEntities(myEntities, apiEntities, !apiMessage.pending);

View File

@ -745,7 +745,7 @@ namespace RichTextProcessor {
export function wrapUrl(url: string, unsafe: number | boolean): string {
if(!url.match(/^https?:\/\//i)) {
url = 'http://' + url;
url = 'https://' + url;
}
var tgMeMatch;
@ -789,7 +789,7 @@ namespace RichTextProcessor {
} else if((telescoPeMatch = url.match(/^https?:\/\/telesco\.pe\/([^/?]+)\/(\d+)/))) {
url = 'tg://resolve?domain=' + telescoPeMatch[1] + '&post=' + telescoPeMatch[2];
} else if(unsafe) {
url = 'tg://unsafe_url?url=' + encodeURIComponent(url);
//url = 'tg://unsafe_url?url=' + encodeURIComponent(url);
}
return url;