Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wiki-embed breaks protocol-relative links #10

Open
nemobis opened this issue Feb 8, 2016 · 1 comment
Open

wiki-embed breaks protocol-relative links #10

nemobis opened this issue Feb 8, 2016 · 1 comment

Comments

@nemobis
Copy link

nemobis commented Feb 8, 2016

With wiki-embed 1.4.6, an URL which action=render outputs as

<a class="external text" href="//commons.wikimedia.org/w/index.php?title=Page">Page</a>

is stripped down to

 <a class="external text" href="Page">Page</a>

which of course doesn't exist locally and hence produces a 404 error.

I've looked into Wiki_Embed::render() and the DOMCSS rules but I couldn't find what is at fault. Am I looking in the wrong place?

Someone at some point claimed this (or similar) was a bug in PHP but then self-closed the bug: https://bugs.php.net/bug.php?id=64946

@nemobis
Copy link
Author

nemobis commented Jan 24, 2018

This was also true for internal links.

On a wiki with $wgServer set to a protocol-relative URL, [[:File:Example.png]] becomes something like <a href="/wiki/File:Example.png" title="/wiki/File:Example.png"> and is kept as such on Wordpress, although www.example.org/wiki/File:Example.png doesn't exist.

After I set wgServer to be a HTTPS URL, the HTML is transformed and the link is preserved as https://wiki.example.org/wiki/File:Example.png.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant