diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-12-16 11:33:41 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-12-16 11:33:41 -0800 |
commit | 6ac82bc6b72e94466787e291e15968f15f33089d (patch) | |
tree | dc556ba9dc8d8138ef5a84fa67709079fe18ee3e /installer/installer.php | |
parent | 8a5bbc896b2b281039a5e34a5fc330b826825dd2 (diff) |
Detect safe_mode and abort the install. Fixes #1534.
Diffstat (limited to 'installer/installer.php')
-rw-r--r-- | installer/installer.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/installer/installer.php b/installer/installer.php index 7d358e70..1771e3aa 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -233,7 +233,30 @@ class installer { $errors[] = "Gallery requires the <a href=\"http://php.net/manual/en/book.ctype.php\">PHP Ctype</a> extension. Please install it."; } + if (self::ini_get_bool("safe_mode")) { + $errors[] = "Gallery cannot function when PHP is in <a href=\"http://php.net/manual/en/features.safe-mode.php\">Safe Mode</a>. Please disable safe mode."; + } + return @$errors; } + /** + * Convert any possible boolean ini value to true/false. + * On = on = 1 = true + * Off = off = 0 = false + */ + static function ini_get_bool($varname) { + $value = ini_get($varname); + + if (!strcasecmp("on", $value) || $value == 1 || $value === true) { + return true; + } + + if (!strcasecmp("off", $value) || $value == 0 || $value === false) { + return false; + } + + return false; + } + } |