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 15:06:03 +0000 |
commit | 344c9682de06134faae31499fe38afb2df55903a (patch) | |
tree | b7b80280c3cc1e446e9c7e7825012ae7207d28cf /lib | |
parent | a7b4808b3286236ba777f55544ef0127bbb6b062 (diff) | |
download | nextcloud-server-344c9682de06134faae31499fe38afb2df55903a.tar.gz nextcloud-server-344c9682de06134faae31499fe38afb2df55903a.zip |
fix: switch from explode to substr (faster)backport/46140/stable30
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 fe97bd01217..aa20f627edc 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; } } |