Allow unsafe urls (maybe this is unsafe)
This commit is contained in:
parent
ee4d05c9e5
commit
69caa741e5
@ -2404,7 +2404,7 @@ export class AppMessagesManager {
|
|||||||
|
|
||||||
apiMessage.rReply = this.getRichReplyText(apiMessage);
|
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 myEntities = RichTextProcessor.parseEntities(apiMessage.message);
|
||||||
const apiEntities = apiMessage.entities || [];
|
const apiEntities = apiMessage.entities || [];
|
||||||
apiMessage.totalEntities = RichTextProcessor.mergeEntities(myEntities, apiEntities, !apiMessage.pending);
|
apiMessage.totalEntities = RichTextProcessor.mergeEntities(myEntities, apiEntities, !apiMessage.pending);
|
||||||
|
@ -745,7 +745,7 @@ namespace RichTextProcessor {
|
|||||||
|
|
||||||
export function wrapUrl(url: string, unsafe: number | boolean): string {
|
export function wrapUrl(url: string, unsafe: number | boolean): string {
|
||||||
if(!url.match(/^https?:\/\//i)) {
|
if(!url.match(/^https?:\/\//i)) {
|
||||||
url = 'http://' + url;
|
url = 'https://' + url;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tgMeMatch;
|
var tgMeMatch;
|
||||||
@ -789,7 +789,7 @@ namespace RichTextProcessor {
|
|||||||
} else if((telescoPeMatch = url.match(/^https?:\/\/telesco\.pe\/([^/?]+)\/(\d+)/))) {
|
} else if((telescoPeMatch = url.match(/^https?:\/\/telesco\.pe\/([^/?]+)\/(\d+)/))) {
|
||||||
url = 'tg://resolve?domain=' + telescoPeMatch[1] + '&post=' + telescoPeMatch[2];
|
url = 'tg://resolve?domain=' + telescoPeMatch[1] + '&post=' + telescoPeMatch[2];
|
||||||
} else if(unsafe) {
|
} else if(unsafe) {
|
||||||
url = 'tg://unsafe_url?url=' + encodeURIComponent(url);
|
//url = 'tg://unsafe_url?url=' + encodeURIComponent(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user