Embed links from OneDrive personal accounts appear to be of the form:
h t t p s : / / o n e d r i v e . l i v e . c o m/embed?resid=ACCOUNTIDENTIFIER!FILEIDENTIFIER&authkey=!ACCESSKEY
We can almost use your tool to allow embedding from OneDrive personal accounts (in a way that restricts it to specific accounts) by setting 'scheme' to h t t p s
, 'domain' to o n e d r i v e . l i v e . c o m/embed?resid=ACCOUNTIDENTIFIER!
, such that users can embed things from trusted accounts via the relevant key and setting 'path' to FILEIDENTIFIER&authkey=!ACCESSKEY
.
The only problem is that the extension always automatically includes a "/" between the domain and the path.
I am an amateur when it comes to PHP and do not know how to use GIT, but to illustrate it looks like a possible solution is to allow another attribute along the lines of SuppressSlashAfterDomain
which defaults to False
, and change line 221 of Iframe_body.php from:
$url = $wgIframe['server'][$key]['scheme'] . '://' . $phost . $wgIframe['server'][$key]['domain'] . '/';
to something like:
$url = $wgIframe['server'][$key]['scheme'] . '://' . $phost . $wgIframe['server'][$key]['domain'];
if (SuppressSlashAfterDomain==False) $url = $url . '/';
BTW please ignore the spaces - it wasn't letting me post when writing normally.