Issue Bug Closed

#16588Inconsistent return values of ini_get() produce false positives for safe_mode detection

Christian Boltz 09/22/06, 22:13 updated 03/29/11, 14:21

Description

Typo3’s install tool told me that safe_mode is on, while I was sure that it was off (also verified using phpinfo().

I pinned down the problem – it has to do with doing PHP settings using php_admin_value / php_admin_flag apache configuration directives.

Testcase:
echo "safe_mode status: " . ini_get('safe_mode');
if (ini_get('safe_mode')) { echo " ACTIVE"; }
?>

The result depends on the apache configuration you use to switch off safe_mode

Result with php_admin_flag safe_mode off (or without overriding php.ini settings at all)
safe_mode status: 0 <— expected

Result with php_admin_value safe_mode off
safe_mode status: off ACTIVE <—- NOT expected

The safe_mode check should check for “on” and true.

- Add php_admin_value safe_mode off to your apache configuration, reload apache
- check safe_mode status in the install tool
(tested using PHP 5.1.2 on SUSE Linux 10.1)

(issue imported from #M4272)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.