mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -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
a7b4808b32
commit
344c9682de
1 changed files with 2 additions and 1 deletions
|
|
@ -228,9 +228,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