diff options
author | Josh Richards <josh.t.richards@gmail.com> | 2024-06-27 10:57:14 -0400 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-09-16 14:56:12 +0000 |
commit | c46fb548c253fec69b58b57fccc87f8195ab6bf7 (patch) | |
tree | d810f00e47ae42ddf2c82dfd867c71b7ce5995c2 | |
parent | cf752657ee74bce2e85a53127d7315df8e7b3c54 (diff) | |
download | nextcloud-server-backport/46140/stable28.tar.gz nextcloud-server-backport/46140/stable28.zip |
fix: switch from explode to substr (faster)backport/46140/stable28
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
-rw-r--r-- | lib/private/Config.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/Config.php b/lib/private/Config.php index 301edcd8c11..d69a9837e75 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -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; } } |