diff --git a/Config_File.class.php b/Config_File.class.php index 9cdac643..f3ecfcde 100644 --- a/Config_File.class.php +++ b/Config_File.class.php @@ -88,13 +88,13 @@ class Config_File extends PEAR { */ function set_path($config_path) { - if (!is_string($config_path) || - (!is_dir($config_path))) { - return new Config_File_Error("Bad config file path '$config_path'"); - } + if (!empty($config_path)) { + if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) { + return new Config_File_Error("Bad config file path '$config_path'"); + } - if ($config_path != "") $this->_config_path = $config_path . $this->_separator; + } } diff --git a/libs/Config_File.class.php b/libs/Config_File.class.php index 9cdac643..f3ecfcde 100644 --- a/libs/Config_File.class.php +++ b/libs/Config_File.class.php @@ -88,13 +88,13 @@ class Config_File extends PEAR { */ function set_path($config_path) { - if (!is_string($config_path) || - (!is_dir($config_path))) { - return new Config_File_Error("Bad config file path '$config_path'"); - } + if (!empty($config_path)) { + if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) { + return new Config_File_Error("Bad config file path '$config_path'"); + } - if ($config_path != "") $this->_config_path = $config_path . $this->_separator; + } }