fixed wrong url-creation which appended multiple protocols

This commit is contained in:
newhinton 2018-12-29 17:38:39 +01:00 committed by GitHub
parent b5f7baab12
commit ee335aab87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,16 +68,16 @@
}
if (regex.test(scope.value)) {
scope.isLink = true;
if(scope.value.substr(0,4) !== 'http'){
var val = scope.value;
scope.value =val.substr(val.indexOf("://")+3,val.length);
}
} else if (regex.test('http://'+scope.value) && scope.isURL){
//This part is added to check if the user did not add http or https to the url and match it nonetheless
scope.isLink = true;
} else {
scope.isLink = false;
}
if(scope.value.substr(0,4) !== 'http'){
var val = scope.value;
scope.value =val.substr(val.indexOf("://")+3,val.length);
}
}
});
if (!scope.toggle) {