Topic on Extension talk:Iframe/Flow

Please could you include an option to suppress the "/" that gets included between the domain and the path?

2
79.68.147.222 (talkcontribs)

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.

79.68.147.222 (talkcontribs)

An alternative to suppressing the "/" would be to have an optional attribute "accountidentifier" that defaults to an empty string and goes in after the domain and the "/".

Reply to "Please could you include an option to suppress the "/" that gets included between the domain and the path?"