Reply to Disabled ini_get_all causes error

Disabled ini_get_all causes error new!
by Pont, 13 years, 10 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

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important