Fix bug #3431742: open_basedir problems with /etc/ config files
This commit is contained in:
parent
c45ea5a3c6
commit
a0f0b2caf7
2 changed files with 21 additions and 6 deletions
|
@ -11,6 +11,7 @@ ChangeLog for SemantiScuttle
|
||||||
- Fix bug #3388219: Incorrect URL when cancelling tag2tag-actions
|
- Fix bug #3388219: Incorrect URL when cancelling tag2tag-actions
|
||||||
- Fix bug #3399815: PHP error in opensearch API in 0.98.3
|
- Fix bug #3399815: PHP error in opensearch API in 0.98.3
|
||||||
- Fix bug #3407728: Can't delete users from admin page
|
- Fix bug #3407728: Can't delete users from admin page
|
||||||
|
- Fix bug #3431742: open_basedir problems with /etc/ config files
|
||||||
- Implement request #3403609: fr_CA translation update
|
- Implement request #3403609: fr_CA translation update
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,9 @@ class SemanticScuttle_Config
|
||||||
*
|
*
|
||||||
* Paths with host name have priority.
|
* Paths with host name have priority.
|
||||||
*
|
*
|
||||||
|
* When open_basedir restrictions are in effect and /etc is not part of
|
||||||
|
* the setting, /etc/semanticscuttle/ is not checked for config files.
|
||||||
|
*
|
||||||
* @return array Array with config file path as first value
|
* @return array Array with config file path as first value
|
||||||
* and default config file path as second value.
|
* and default config file path as second value.
|
||||||
* Any may be NULL if not found
|
* Any may be NULL if not found
|
||||||
|
@ -72,12 +75,23 @@ class SemanticScuttle_Config
|
||||||
$host = basename($_SERVER['HTTP_HOST']);
|
$host = basename($_SERVER['HTTP_HOST']);
|
||||||
$datadir = $this->getDataDir();
|
$datadir = $this->getDataDir();
|
||||||
|
|
||||||
$arFiles = array(
|
$openbase = ini_get('open_basedir');
|
||||||
$datadir . 'config.' . $host . '.php',
|
if ($openbase && strpos($openbase, '/etc') === false) {
|
||||||
'/etc/semanticscuttle/config.' . $host . '.php',
|
//open_basedir restrictions enabled and /etc not allowed?
|
||||||
$datadir . 'config.php',
|
// then don't look in /etc for config files.
|
||||||
'/etc/semanticscuttle/config.php',
|
// the check is not perfect, but it covers most cases
|
||||||
);
|
$arFiles = array(
|
||||||
|
$datadir . 'config.' . $host . '.php',
|
||||||
|
$datadir . 'config.php',
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$arFiles = array(
|
||||||
|
$datadir . 'config.' . $host . '.php',
|
||||||
|
'/etc/semanticscuttle/config.' . $host . '.php',
|
||||||
|
$datadir . 'config.php',
|
||||||
|
'/etc/semanticscuttle/config.php',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$configfile = null;
|
$configfile = null;
|
||||||
foreach ($arFiles as $file) {
|
foreach ($arFiles as $file) {
|
||||||
|
|
Loading…
Reference in a new issue