diff options
author | Josh Richards <josh.t.richards@gmail.com> | 2024-06-27 10:57:14 -0400 |
---|---|---|
committer | Josh <josh.t.richards@gmail.com> | 2024-07-08 16:41:58 -0400 |
commit | 34a9e48827b3a03da48699d32c6138c2c89c139f (patch) | |
tree | d745ebbd5018c201ab52c0fce9b94d51767bb885 /lib | |
parent | 2ffff5146198b33724ccd8f1e9c9fa5cead54054 (diff) | |
download | nextcloud-server-34a9e48827b3a03da48699d32c6138c2c89c139f.tar.gz nextcloud-server-34a9e48827b3a03da48699d32c6138c2c89c139f.zip |
fix: switch from explode to substr (faster)
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Diffstat (limited to 'lib')
-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 7ff7312ddea..46c32d5f628 100644 --- a/lib/private/Config.php +++ b/lib/private/Config.php @@ -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; } } |