return false early on 'null' origin
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Change-Id: I9cdb26c3d2787beac6e2344d5f768e0fa6993bd8 (cherry picked from commitpull/8235/headd1e00dbe1b
) (cherry picked from commitc536e34f4e
)
parent
fd34d9c11e
commit
5ce656a34f
|
@ -180,13 +180,14 @@ L.Map.WOPI = L.Handler.extend({
|
|||
// Checking whether a message came from our iframe's parents is
|
||||
// un-necessarily difficult.
|
||||
_allowMessageOrigin: function(e) {
|
||||
// e.origin === 'null' when sandboxed
|
||||
if (e.origin === 'null')
|
||||
return false;
|
||||
|
||||
// cache - to avoid regexps.
|
||||
if (this._cachedGoodOrigin && this._cachedGoodOrigin === e.origin)
|
||||
return true;
|
||||
|
||||
// e.origin === 'null' when sandboxed (i.e. when the parent is a file on local filesystem).
|
||||
if (e.origin === 'null')
|
||||
return true;
|
||||
try {
|
||||
if (e.origin === window.parent.origin)
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue