Page MenuHomePhabricator

img_auth.php cannot generate thumbnails for non-existent size and returns HTTP 403
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • the contents of .htaccess
RewriteRule ^/?w/images(/.*)$ %{DOCUMENT_ROOT}/w/img_auth.php?path=$1 [L]
  • Upload Example.jpg to /path/to/image/store/6/6a/Example.webp
  • ls -al /path/to/image/store/thumb/6/6a/Example.webp/888px-Example.jpg
ls: cannot access '/path/to/image/store/thumb/6/6a/Example.webp/888px-Example.webp.png': No such file or directory
  • curl -vk https://mediawiki.localhost/w/images/thumb/6/6a/Example.jpg/888px-Example.webp.png

What happens?:
Server return HTTP 403 instead of generate thumbnails.

What should have happened instead?:
img_auth.php should generate thumbnails.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
mediawiki/core REL1_41 9cb75a0

Other information (browser name/version, screenshots, etc.):
part of debug.log ($wgDebugLogFile)

[FileOperation] FileBackendStore::ingestFreshFileStats: File mwstore://local-backend/local-thumb/6/6a/Example.webp/888px-Example.webp.png does not exist
[img_auth] wfForbidden Hdr: Access denied Msg: File "mwstore://local-backend/local-thumb/6/6a/Example.webp/888px-Example.webp.png" does not exist.

MediaWiki will generate thumbnails if you replace the contents of .htaccess with

RewriteRule ^/?w/images((?!/thumb)/.*)$ %{DOCUMENT_ROOT}/w/img_auth.php?path=$1 [L]
RewriteRule ^/?w/images/thumb(/.*)$ %{DOCUMENT_ROOT}/w/thumb_handler.php?path=$1 [L]

Related Objects