Page MenuHomePhabricator

File links with local project prefix cause images to be transcluded
Closed, ResolvedPublic


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.

Version: 1.24rc
Severity: critical
See Also:



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:32 AM
bzimport set Reference to bz68802.
bzimport added a subscriber: Unknown Object (MLST).

This might be the same issue as bug 68085, which has been already fixed (but not yet deployed).

I can't tell if that will fix it. I will know as soon as it is deployed to enwiki.

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.

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.

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.

Change 150511 had a related patch set uploaded by TTO:
Don't include images/categories when behind a local interwiki prefix

Change 150511 merged by jenkins-bot:
Don't include images/categories when behind a local interwiki prefix

Should be fixed. Please verify on beta labs.