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

New commits:
commit 0d23d91fe3b8e25fd0c2c1049df2e31ac98369ed
Author:     Henry Castro <[email protected]>
AuthorDate: Mon May 4 11:07:01 2020 -0400
Commit:     Henry Castro <[email protected]>
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 <[email protected]>
    Reviewed-by: Henry Castro <[email protected]>
    Reviewed-by: Michael Meeks <[email protected]>

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;
        },
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to