Last modified: 2014-09-01 09:41:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T43273, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41273 - "Download as PDF" contains broken licence link
"Download as PDF" contains broken licence link
Status: PATCH_TO_REVIEW
Product: MediaWiki extensions
Classification: Unclassified
Collection (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 46891 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-22 16:35 UTC by Arnd Behring
Modified: 2014-09-01 09:41 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Arnd Behring 2012-10-22 16:35:10 UTC
When exporting a wiki page as PDF, the PDF file contains a section called "License". At least for pages under a Creative Commons License, this includes an URL to the text of the license. This URL is plain text (not hyperlinked) and contains no protocol specifier (//creativecommons.org/licenses/by-sa/3.0/
 instead of http://creativecommons.org/licenses/by-sa/3.0/).

While this may be an instance of protocol neutral links, I think that it would be more helpful if these were complete links (starting with either http:// or https://). Browsers generally seem to interpret links starting with a slash as file:// links (at least on Linux).

How to reproduce:
1) Go to http://www.mediawiki.org/ or http://en.wikipedia.org/.
2) In the sidebar, click "Print/export" and then "Download as PDF"
3) Wait for the rendering to finish and download the PDF
4) Open the PDF file, scroll to the last page and look at the "License" section
Comment 1 Mark Holmquist 2012-10-22 16:57:56 UTC
Protip for whoever implements this:

It should basically be an instance of finding any links prefixed with "//" in the page and replacing it with a proper link. It shouldn't be all too difficult.

If one of the Collection devs agrees, I'd like to add the "easy" keyword here.
Comment 2 Volker Haas 2012-10-30 14:04:10 UTC
The license text is configurable - therefore I propose to change the text to include a protocol for the URL. 

Currently the link is not even detected being a link (b/c of the missing protocol) therefore I can't simply add the protocol to the link. And I am reluctant to use a regex on all of the license text and replace stuff that looks like a link without a protocol.
Comment 3 Derk-Jan Hartman 2012-10-31 13:11:55 UTC
This is because by default mw-rights-url is used. If the system can't handle protocol relative urls, just put it trough wfExpandUrl( url, PROTO_CURRENT ), before outputting;

Or actually, due to possible lack of protocol awareness in caching layer of PDF rendered documents, it should probably be wfExpandUrl( url, PROTO_HTTP );

This makes me wonder however about the protocol relative capabilities of the rest of the renderer. We have these things all over the place.
Comment 4 Derk-Jan Hartman 2012-10-31 19:31:54 UTC
https://gerrit.wikimedia.org/r/31069
Comment 5 Derk-Jan Hartman 2013-03-20 18:39:45 UTC
changeset abandoned
Comment 6 Andre Klapper 2013-07-25 07:54:40 UTC
Patch abandoned only because followup questions were not answered by reviewers, e.g. "WHICH configuration variable is used to import that fragment".
Comment 7 Marcin Cieślak 2014-09-01 09:41:39 UTC
*** Bug 46891 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links