Disabled ini_get_all causes error

See all posts Reply

Disabled ini_get_all causes error new!
by Pont, 14 years, 5 months ago
Hi!
All of a sudden I got the following error message when using class.upload.php.

ini_get_all() has been disabled for security reasons...

It seems my host has disabled that function and now that configuration change causes an error in your class. I suggest changing the following lines (from line 1788)
// display some system information
if (empty($this->log)) {
    $this->log .= 'system information';
    $inis = ini_get_all();
    $open_basedir = (array_key_exists('open_basedir', $inis) && array_key_exists('local_value', $inis['open_basedir']) && !empty($inis['open_basedir']['local_value'])) ? $inis['open_basedir']['local_value'] : false;

to

// display some system information
if (empty($this->log)) {
    $this->log .= 'system information';
    if (function_exists('ini_get_all')) {
        $inis = ini_get_all();
        $open_basedir = (array_key_exists('open_basedir', $inis) && array_key_exists('local_value', $inis['open_basedir']) && !empty($inis['open_basedir']['local_value'])) ? $inis['open_basedir']['local_value'] : false;
    } else {
        $open_basedir = false;
    }

Since ini_get_all is considered a dangerous function it probably isn't unusual to have it disabled on the server. The above change makes your class imune.Reply
Re: Disabled ini_get_all causes error new!
by colin, 14 years, 5 months ago
Thanks, I will look into it, and fix the next releaseReply