Fixed unwanted tg proto URLs handling

This commit is contained in:
Igor Zhukov 2018-02-13 22:34:28 +04:00
parent 55c661a2c7
commit 32f67b18bb
2 changed files with 4 additions and 1 deletions

View File

@ -1925,7 +1925,7 @@ angular.module('izhukov.utils', [])
} }
function wrapUrl (url, unsafe) { function wrapUrl (url, unsafe) {
if (!url.match(/^(https?|tg):\/\//i)) { if (!url.match(/^https?:\/\//i)) {
url = 'http://' + url url = 'http://' + url
} }
var tgMeMatch var tgMeMatch

View File

@ -4797,6 +4797,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
url.search('https://t.me/') === 0) { url.search('https://t.me/') === 0) {
target = '_self' target = '_self'
} }
else if (!url.match(/^https?:\/\//)) {
url = 'http://' + url
}
var popup = window.open(url, target) var popup = window.open(url, target)
try { try {
popup.opener = null; popup.opener = null;