added check is_readable for user config file

This commit is contained in:
Sebastian Mendel
2005-12-14 17:12:28 +00:00
parent 76bbf08a3d
commit 248d12363d
2 changed files with 9 additions and 2 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
2005-12-14 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* libraries/Config.class.php: added check is_readable for user config file
2005-12-14 Michal Čihař <michal@cihar.com>
* libraries/config.default.php, Documentation.html: Transliterate invalid
chars by default (RFE #1380255).

View File

@@ -382,6 +382,10 @@ class PMA_Config
return false;
}
if ( ! is_readable($source) ) {
die('Existing configuration file (' . $source . ') is not readable.');
}
// Check for permissions (on platforms that support it):
$perms = @stat($source);
if (!($perms === FALSE) && ($perms['mode'] & 2)) {
@@ -390,7 +394,7 @@ class PMA_Config
// Refuse to work while there still might be some world writable dir:
if (is_dir('./config')) {
die('Remove config directory before using phpMyAdmin!');
die('Remove "./config" directory before using phpMyAdmin!');
}
$this->source = trim($source);