Don't rely on case sensitive usernames in preferences stored in INI files

refs #11051
This commit is contained in:
Alexander A. Klimov 2016-02-10 16:21:19 +01:00
parent 2e400ba654
commit 001c63e376

View File

@ -472,11 +472,17 @@ class Config implements Countable, Iterator, Selectable
$filename = $type . 's.ini'; $filename = $type . 's.ini';
} }
return static::resolvePath( if ($username) {
($username ? 'preferences' . DIRECTORY_SEPARATOR . $username : 'navigation') $path = static::resolvePath(implode(DIRECTORY_SEPARATOR, array('preferences', $username, $filename)));
. DIRECTORY_SEPARATOR if (realpath($path) === false) {
. $filename $path = static::resolvePath(implode(DIRECTORY_SEPARATOR, array(
); 'preferences', strtolower($username), $filename
)));
}
} else {
$path = static::resolvePath('navigation' . DIRECTORY_SEPARATOR . $filename);
}
return $path;
} }
/** /**