loleaflet: fix the regular expression to match the ancestor's origin
A better fix to allow the ancestor frame does not block uploading images from cloud storage for FireFox and IE browsers Change-Id: Id69c4e0d1479f7c098e7774bdb220a631dc25855 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93430 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This commit is contained in:
parent
b6bffd7e65
commit
0d23d91fe3
1 changed files with 1 additions and 7 deletions
|
@ -166,7 +166,7 @@ L.Map.WOPI = L.Handler.extend({
|
|||
this._allowedOrigins = ancestors;
|
||||
// convert to JS regexps from localhost:* to https*://localhost:.*
|
||||
for (i = 0; i < ancestors.length; i++) {
|
||||
this._allowedOrigins[i] = 'https*://' + ancestors[i].replace(/:\*/, ':.*');
|
||||
this._allowedOrigins[i] = '(http|https)://' + ancestors[i].replace(/:\*/, ':?.*');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,12 +189,6 @@ L.Map.WOPI = L.Handler.extend({
|
|||
return true;
|
||||
}
|
||||
|
||||
var origin = window.location.protocol + '//' + window.location.hostname;
|
||||
if (origin === e.origin) {
|
||||
this._cachedGoodOrigin = e.origin;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue