mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-21 10:50:10 +00:00
some general fixes to the code base
- Fix return vs continue in CreateVolumes: using return caused all subsequent volumes to be skipped when nextcloud_aio_nextcloud_datadir or nextcloud_aio_backupdir appeared in the volume list - Fix GetLogs parsing loop: the while loop checked $line before reassigning it so the false sentinel from strtok was always processed, appending a spurious extra empty line to the output - Fix getRegisteredSecret unsafe array access: accessing $this->secrets[$secretId] without isset() can trigger an undefined array key warning; use isset() instead - Remove redundant startTransaction() call in setDomain(): the method called startTransaction() twice without an intervening commitTransaction(), making the second call a no-op that was misleading Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/19424687-dda1-4510-8f70-068c8d3efd41 Co-Authored-By: szaimen <42591237+szaimen@users.noreply.github.com> Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
committed by
Simon L.
parent
0cea791a64
commit
546474346f
@@ -363,7 +363,7 @@ class ConfigurationManager
|
||||
}
|
||||
|
||||
public function getRegisteredSecret(string $secretId) : string {
|
||||
if ($this->secrets[$secretId]) {
|
||||
if (isset($this->secrets[$secretId])) {
|
||||
return $this->getAndGenerateSecret($secretId);
|
||||
}
|
||||
throw new \Exception("The secret " . $secretId . " was not registered. Please check if it is defined in secrets of containers.json.");
|
||||
@@ -563,7 +563,6 @@ class ConfigurationManager
|
||||
$this->set('domain', $domain);
|
||||
// Reset the borg restore password when setting the domain
|
||||
$this->borgRestorePassword = '';
|
||||
$this->startTransaction();
|
||||
$this->commitTransaction();
|
||||
}
|
||||
|
||||
|
||||
@@ -157,11 +157,12 @@ readonly class DockerActionManager {
|
||||
$response = "";
|
||||
$separator = "\r\n";
|
||||
$line = strtok($responseBody, $separator);
|
||||
$response = substr((string)$line, 8) . $separator;
|
||||
if ($line !== false) {
|
||||
$response = substr($line, 8) . $separator;
|
||||
}
|
||||
|
||||
while ($line !== false) {
|
||||
$line = strtok($separator);
|
||||
$response .= substr((string)$line, 8) . $separator;
|
||||
while (($line = strtok($separator)) !== false) {
|
||||
$response .= substr($line, 8) . $separator;
|
||||
}
|
||||
|
||||
return $response;
|
||||
@@ -187,7 +188,7 @@ readonly class DockerActionManager {
|
||||
];
|
||||
|
||||
if ($volume->name === 'nextcloud_aio_nextcloud_datadir' || $volume->name === 'nextcloud_aio_backupdir') {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
$firstChar = substr($volume->name, 0, 1);
|
||||
|
||||
Reference in New Issue
Block a user