From 518649709027be266a52eed82ef9a987a68545cb Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 27 Jan 2020 08:59:35 +0100 Subject: [PATCH] Use immutable date when starting phases, try to prevent php7.4 null array access error --- Blacklight/processing/ProcessReleases.php | 20 ++++++++++---------- Changelog | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Blacklight/processing/ProcessReleases.php b/Blacklight/processing/ProcessReleases.php index 02072174c..728aea059 100755 --- a/Blacklight/processing/ProcessReleases.php +++ b/Blacklight/processing/ProcessReleases.php @@ -270,7 +270,7 @@ class ProcessReleases */ public function processIncompleteCollections($groupID): void { - $startTime = now(); + $startTime = now()->toImmutable(); if ($this->echoCLI) { $this->consoleTools->header('Process Releases -> Attempting to find complete collections.'); @@ -312,7 +312,7 @@ class ProcessReleases */ public function processCollectionSizes($groupID): void { - $startTime = now(); + $startTime = now()->toImmutable(); if ($this->echoCLI) { $this->consoleTools->header('Process Releases -> Calculating collection sizes (in bytes).'); @@ -356,7 +356,7 @@ class ProcessReleases */ public function deleteUnwantedCollections($groupID): void { - $startTime = now(); + $startTime = now()->toImmutable(); if ($this->echoCLI) { $this->consoleTools->header('Process Releases -> Delete collections smaller/larger than minimum size/file count from group/site setting.'); @@ -446,7 +446,7 @@ class ProcessReleases */ public function createReleases($groupID): array { - $startTime = now(); + $startTime = now()->toImmutable(); $categorize = new Categorize(); $returnCount = $duplicate = 0; @@ -491,7 +491,7 @@ class ProcessReleases if (\is_array($cleanedName)) { $properName = $cleanedName['properlynamed']; $preID = $cleanedName['predb'] ?? false; - $cleanedName = $cleanedName['cleansubject']; + $cleanedName = $cleanedName['cleansubject'] ?? $cleanRelName; } else { $properName = true; $preID = false; @@ -631,7 +631,7 @@ class ProcessReleases */ public function createNZBs($groupID): int { - $startTime = now(); + $startTime = now()->toImmutable(); if ($this->echoCLI) { $this->consoleTools->header('Process Releases -> Create the NZB, delete collections/binaries/parts.'); @@ -682,7 +682,7 @@ class ProcessReleases */ public function categorizeReleases($categorize, $groupID = ''): void { - $startTime = now(); + $startTime = now()->toImmutable(); if ($this->echoCLI) { $this->consoleTools->header('Process Releases -> Categorize releases.'); } @@ -736,7 +736,7 @@ class ProcessReleases */ public function deleteCollections($groupID): void { - $startTime = now(); + $startTime = now()->toImmutable(); $deletedCount = 0; @@ -828,7 +828,7 @@ class ProcessReleases */ public function deletedReleasesByGroup($groupID = ''): void { - $startTime = now(); + $startTime = now()->toImmutable(); $minSizeDeleted = $maxSizeDeleted = $minFilesDeleted = 0; if ($this->echoCLI) { @@ -887,7 +887,7 @@ class ProcessReleases */ public function deleteReleases(): void { - $startTime = now(); + $startTime = now()->toImmutable(); $genres = new Genres(); $passwordDeleted = $duplicateDeleted = $retentionDeleted = $completionDeleted = $disabledCategoryDeleted = 0; $disabledGenreDeleted = $miscRetentionDeleted = $miscHashedDeleted = $categoryMinSizeDeleted = 0; diff --git a/Changelog b/Changelog index b63d6b96e..ff5d88e72 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2020-01-27 DariusIII + * Chg: Use immutable date when starting phases, try to prevent php7.4 null array access error 2020-01-26 DariusIII * Chg: Remove check for mysql/mariadb version when installing NNTmux 2020-01-14 DariusIII