Last modified: 2010-05-15 15:59:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 11355 - safe_mode check broken (fix inside)
safe_mode check broken (fix inside)
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
  Show dependency treegraph
Reported: 2007-09-15 22:37 UTC by Philipp Gruber
Modified: 2010-05-15 15:59 UTC (History)
0 users

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


Description Philipp Gruber 2007-09-15 22:37:37 UTC
In my wiki, when generating thumbnails, I got an error which said, that it can't generate thumbnails because safe_mode was on, although I disabled safe_mode.

After searching in the code, I found the followig:

    if( ini_get( 'safe_mode' )) {
        wfDebug( "wfShellExec can't run in safe_mode, PHP's exec functions are too broken.\n" );
        $retval = 1;
        return "Unable to run external programs in safe mode.";

The problem here is, that the if only checks wether the variable safe_mode is set. In my case, it was actually set, but the value is 'Off'. 

Then I changed it to 
    if( ini_get( 'safe_mode' ) && ini_get('safe_mode') != 'Off') {
And now it works fine. It's not a nice solution, but it works for me. Not sure wether it is neccessary to check also for 'off', '0', 'false', etc.


Comment 1 Brion Vibber 2007-09-17 19:54:58 UTC
Fixed in r25896.

The problem seems to be that PHP is a bit inconsistent about what it returns for these settings; when they're set via php_value or php_admin_value in the Apache configuration, it returns the original string instead of the boolean value, while normally they're normalized to '0' or '1' based on the interpretation of the php.ini or php_flag / php_admin_flag setting.

This gets confusing because the way it interprets the strings is different from how PHP coerces strings into boolean values. I've attempted to replicate this in a new wfIniGetBool() wrapper, which in my quick testing seems to match.

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