[Libreoffice-commits] online.git: loleaflet/src

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Mon May 4 16:02:05 UTC 2020


 loleaflet/src/map/handler/Map.WOPI.js |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 0d23d91fe3b8e25fd0c2c1049df2e31ac98369ed
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Mon May 4 11:07:01 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Mon May 4 18:01:36 2020 +0200

    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 at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index a65a6030b..da79219e8 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -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;
 	},
 


More information about the Libreoffice-commits mailing list