Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: switch from explode to substr (faster)
Signed-off-by: Josh Richards <[email protected]>
  • Loading branch information
joshtrichards authored and backportbot[bot] committed Sep 16, 2024
commit c46fb548c253fec69b58b57fccc87f8195ab6bf7
3 changes: 2 additions & 1 deletion lib/private/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,10 @@ private function readData() {
// 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;
}
}
Expand Down