MediaWiki extension AControlImageLink

Clone this repo:
  1. 2d05905 build: Updating eslint-config-wikimedia to 0.27.0 by libraryupgrader · 9 days ago master
  2. 331f85f build: Updating mediawiki/mediawiki-codesniffer to 43.0.0 by libraryupgrader · 6 weeks ago REL1_42
  3. 3b2d0ef build: Updating npm dependencies by libraryupgrader · 3 months ago
  4. eb3bc13 build: Updating npm dependencies by libraryupgrader · 3 months ago
  5. 4dddfbb build: Updating grunt-banana-checker to 0.11.0 by libraryupgrader · 11 months ago

What it does

This extension prevents [[File:Something.pdf|thumb]] from rendering on the pages if all of the following is true:

  1. pdf is listed in $wgAControlImageLinkRestrictedExtensions array:
$wgAControlImageLinkRestrictedExtensions = [ 'pdf' ],
  1. File:Something.pdf has <accesscontrol> tag,
  2. Article that includes [[File:]] syntax either doesn't have <accesscontrol> tag, or its <accesscontrol> tag is different from <accesscontrol> on File:Something.pdf.

If thumbnailing was prevented, an image link will be shown instead of thumbnail.

Why is this needed

For example, a wiki might want to display a page from PDF book, but also show some disclaimers or something on the same page as PDF thumbnail.

This extension can be used to prevent including this PDF book to pages which are not marked as pages where this PDF book can be included.

(you can allow it by adding <accesscontrol> tag to File:Something.pdf and article)