Page MenuHomePhabricator

Thumbnail script doesn't work in PHP Safe Mode
Closed, DeclinedPublic

Description

Author: noels01

Description:
Hi,

I read that setting
$wgThumbnailScriptPath = "{$wgScriptPath}/thumb.php";
will generate thumbnails on each request rather than putting them in the (non-writable) thumb directory (because of safe mode). But this doesn't work. If I access a thumb there's only an error message concerning Safe Mode

SAFE MODE Restriction in effect. The script whose uid is 100 is not allowed to access /path/to/wiki/images/thumb/MyPic.jpg owned by uid 10 in /path/to/wiki/includes/media/Bitmap.php on line 214

File not found
Although this PHP script (/wiki/thumb.php) exists, the file requested for output (/path/to/wiki/images/thumb/MyPic.jpg/120px-MyPic.jpg) does not.

Well, why should the script access the thumb directory at all? As I understand, setting $wgThumbnailScriptPath should prevent thumb generation in the filesystem.

current upload config

$wgEnableUploads = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgUploadDirectory = "{$IP}/images";
$wgHashedUploadDirectory = false;
$wgFileStore['deleted']['hash'] = 0;
$wgMaxUploadSize = 20*1024*1024;
$wgThumbnailScriptPath = "{$wgScriptPath}/thumb.php";
$wgShowExceptionDetails = true;


Version: 1.13.x
Severity: major
OS: Linux

Details

Reference
bz17041

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:26 PM
bzimport set Reference to bz17041.
bzimport added a subscriber: Unknown Object (MLST).

No, that's not what thumb.php does. Please tell me where you read this so I can fix it.