diff --git a/lib/Controller/ArchiveController.php b/lib/Controller/ArchiveController.php index c4510489..1e416d14 100644 --- a/lib/Controller/ArchiveController.php +++ b/lib/Controller/ArchiveController.php @@ -84,6 +84,7 @@ class ArchiveController extends ApiBase if ($parent->getName() === \OCA\Memories\Util::$ARCHIVE_FOLDER) { $isArchived = true; + break; } @@ -98,7 +99,8 @@ class ArchiveController extends ApiBase $unarchive = isset($body['archive']) && false === $body['archive']; if ($isArchived && !$unarchive) { return new JSONResponse(['message' => 'File already archived'], Http::STATUS_BAD_REQUEST); - } else if (!$isArchived && $unarchive) { + } + if (!$isArchived && $unarchive) { return new JSONResponse(['message' => 'File not archived'], Http::STATUS_BAD_REQUEST); } diff --git a/lib/Db/TimelineQueryDays.php b/lib/Db/TimelineQueryDays.php index bd0a1749..9b74ca5f 100644 --- a/lib/Db/TimelineQueryDays.php +++ b/lib/Db/TimelineQueryDays.php @@ -221,7 +221,7 @@ trait TimelineQueryDays /** * The root folder id for the folder. - * We fallback to this if rootid is not found + * We fallback to this if rootid is not found. */ $defaultRootId = 0;