mirror of
https://github.com/nextcloud/server.git
synced 2026-06-19 13:39:40 -04:00
fix: switch from explode to substr (faster)
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
This commit is contained in:
parent
cf752657ee
commit
c46fb548c2
1 changed files with 2 additions and 1 deletions
|
|
@ -259,9 +259,10 @@ class Config {
|
|||
// grab any "NC_" environment variables
|
||||
$envRaw = getenv();
|
||||
// only save environment variables prefixed with "NC_" in the cache
|
||||
$envPrefixLen = strlen(self::ENV_PREFIX);
|
||||
foreach ($envRaw as $rawEnvKey => $rawEnvValue) {
|
||||
if (str_starts_with($rawEnvKey, self::ENV_PREFIX)) {
|
||||
$realKey = explode(self::ENV_PREFIX, $rawEnvKey)[1];
|
||||
$realKey = substr($rawEnvKey, $envPrefixLen);
|
||||
$this->envCache[$realKey] = $rawEnvValue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue