Refactor LinkAnnotation slightly to add data.url/data.dest at the end

This patch also makes sure that all URLs are converted to the correct encoding.
This commit is contained in:
Jonas Jenwald 2016-03-03 13:07:22 +01:00
parent 4a601ffc28
commit b63ef7a8b6
3 changed files with 60 additions and 49 deletions

View file

@ -312,7 +312,7 @@ function isSameOrigin(baseUrl, otherUrl) {
// Validates if URL is safe and allowed, e.g. to avoid XSS.
function isValidUrl(url, allowRelative) {
if (!url) {
if (!url || typeof url !== 'string') {
return false;
}
// RFC 3986 (http://tools.ietf.org/html/rfc3986#section-3.1)