Last modified: 2014-08-09 13:57:32 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 T70802, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68802 - File links with local project prefix cause images to be transcluded
File links with local project prefix cause images to be transcluded
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.24rc
All All
: High critical (vote)
: 1.24.0 release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-29 13:54 UTC by Erwin Dokter
Modified: 2014-08-09 13:57 UTC (History)
2 users (show)

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


Attachments

Description Erwin Dokter 2014-07-29 13:54:13 UTC
Reported on [[WP:VPT]]. Marking as critical.

When local file links are prefixed with a project code, ie. [[w:File:Example.jpg]] or [[en:File:Example.jpg]], the image will be transcluded instead of producing a link. This is a regression.

Example: [[Wikipedia:Help desk/Archives/2008 June 29#Resizing images already used on Wikipedia]]

This is quite serious as links to images on potentially many, many talk archives are now transcluded, which violates our copyright policies.
Comment 1 Bartosz Dziewoński 2014-07-29 13:57:31 UTC
This might be the same issue as bug 68085, which has been already fixed (but not yet deployed).
Comment 2 Erwin Dokter 2014-07-29 16:45:28 UTC
I can't tell if that will fix it. I will know as soon as it is deployed to enwiki.
Comment 3 This, that and the other (TTO) 2014-07-29 22:44:06 UTC
No, unfortunately that won't fix it.

I don't think I'd be exaggerating too much if I said this behaviour has been present in MediaWiki for ten years. It's only becoming apparent now that the WMF local interwiki config has been set correctly.

It's not immediately clear to me how this should be fixed. I'll give it a good think and submit a patch ASAP, as I see this is causing fair use violations on enwiki.
Comment 4 This, that and the other (TTO) 2014-07-29 23:56:12 UTC
I don't have access to Git right now, but the correct fix would be to move the substr_compare test, currently on line 2107 of Parser.php, up to the if statement on line 2099:

if ( $noforce && substr_compare( $this->getTargetLanguage()->lc( ltrim( $origLink ) ), $iw, 0, strlen( $iw ) ) === 0 ) {

And obviously also move the corresponding comment, and change it to mention both this bug and bug 68085. If someone could do that it'd be great.
Comment 5 This, that and the other (TTO) 2014-07-29 23:58:15 UTC
Actually don't know if that would work 100%... in any case it probably needs to be || rather than && and !== instead of ===... I'll come back to it later when I have more time.
Comment 6 Gerrit Notification Bot 2014-07-30 10:26:17 UTC
Change 150511 had a related patch set uploaded by TTO:
Don't include images/categories when behind a local interwiki prefix

https://gerrit.wikimedia.org/r/150511
Comment 7 Gerrit Notification Bot 2014-08-09 11:51:11 UTC
Change 150511 merged by jenkins-bot:
Don't include images/categories when behind a local interwiki prefix

https://gerrit.wikimedia.org/r/150511
Comment 8 Bartosz Dziewoński 2014-08-09 13:57:32 UTC
Should be fixed. Please verify on beta labs.

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


Navigation
Links