diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 3510b675d4d3..3af3dc6a7fb3 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -193,9 +193,9 @@ private static function prepareMountPointEntry(StorageConfig $storage, $isPerson */ public static function setUserVars($user, $input) { if (is_array($input)) { - foreach ($input as &$value) { + foreach ($input as $key => $value) { if (is_string($value)) { - $value = str_replace('$user', $user, $value); + $input[$key] = str_replace('$user', $user, $value); } } } else { @@ -219,8 +219,8 @@ public static function getBackendStatus($class, $options, $isPersonal, $testOnly if (self::$skipTest) { return StorageNotAvailableException::STATUS_SUCCESS; } - foreach ($options as &$option) { - $option = self::setUserVars(OCP\User::getUser(), $option); + foreach ($options as $key => $option) { + $option[$key] = self::setUserVars(OCP\User::getUser(), $option); } if (class_exists($class)) { try {