summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJosh Richards <josh.t.richards@gmail.com>2024-06-27 10:57:14 -0400
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-09-16 14:57:26 +0000
commit75555d34b19d5eef96c4cc4fe2bd2033ad5ee6a5 (patch)
tree93732e9719a452d774ffd95033f160704801a319 /lib
parent80bbffa78a7c826493f8a68439f467a26780477b (diff)
downloadnextcloud-server-75555d34b19d5eef96c4cc4fe2bd2033ad5ee6a5.tar.gz
nextcloud-server-75555d34b19d5eef96c4cc4fe2bd2033ad5ee6a5.zip
fix: switch from explode to substr (faster)backport/46140/stable29
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Config.php3
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;
}
}