From 16813ac91775762cecfc8f84a6aa1104616f4b37 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 16 Aug 2019 22:08:05 +0200 Subject: [PATCH 1/3] Revert change to _passwordstatus --- Blacklight/processing/post/ProcessAdditional.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index cd99020a64..d5e1fd5219 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -318,7 +318,7 @@ class ProcessAdditional /** * Password status of the current release. - * @var string + * @var array */ protected $_passwordStatus; @@ -1087,7 +1087,7 @@ protected function _processCompressedData(&$compressedData): bool $this->_debug('ArchiveInfo: Compressed file has a password.'); } $this->_releaseHasPassword = true; - $this->_passwordStatus = Releases::PASSWD_RAR; + $this->_passwordStatus[] = Releases::PASSWD_RAR; return false; } @@ -1154,13 +1154,13 @@ protected function _processCompressedFileList(): bool if (isset($file['pass']) && $file['pass'] === true) { $this->_releaseHasPassword = true; - $this->_passwordStatus = Releases::PASSWD_RAR; + $this->_passwordStatus[] = Releases::PASSWD_RAR; break; } if ($this->_innerFileBlacklist !== false && preg_match($this->_innerFileBlacklist, $file['name'])) { $this->_releaseHasPassword = true; - $this->_passwordStatus = Releases::PASSWD_POTENTIAL; + $this->_passwordStatus[] = Releases::PASSWD_POTENTIAL; break; } @@ -1216,7 +1216,7 @@ protected function _addFileInfo(&$file): void if (ReleaseFile::addReleaseFiles($this->_release->id, $file['name'], $file['size'], $file['date'], $file['pass'], '', $file['crc32'] ?? '')) { $this->_addedFileInfo++; if ((int) $file['pass'] === 1) { - $this->_passwordStatus = Releases::PASSWD_RAR; + $this->_passwordStatus[] = Releases::PASSWD_RAR; } if ($this->_echoCLI) { @@ -1231,7 +1231,7 @@ protected function _addFileInfo(&$file): void $this->_debug('Codec spam found, setting release to potentially passworded.'); } $this->_releaseHasPassword = true; - $this->_passwordStatus = Releases::PASSWD_POTENTIAL; + $this->_passwordStatus[] = Releases::PASSWD_POTENTIAL; } //Run a PreDB filename check on insert to try and match the release elseif ($file['name'] !== '' && strpos($file['name'], '.') !== 0) { $this->_release['filename'] = $file['name']; From 26097d62d524a68bd766d9625bf530d7aa1421d0 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 16 Aug 2019 22:24:10 +0200 Subject: [PATCH 2/3] Missed one --- Blacklight/processing/post/ProcessAdditional.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index d5e1fd5219..234ed43603 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -2300,7 +2300,7 @@ protected function _resetReleaseStatus(): void $this->_foundSample = $this->_processThumbnails ? false : true; $this->_foundPAR2Info = false; - $this->_passwordStatus = Releases::PASSWD_NONE; + $this->_passwordStatus[] = Releases::PASSWD_NONE; $this->_releaseHasPassword = false; $this->_releaseGroupName = UsenetGroup::getNameByID($this->_release->groups_id); From d65064fd197e252426c1d5e99771eac345a6965c Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 16 Aug 2019 22:44:47 +0200 Subject: [PATCH 3/3] Fix PPA --- Blacklight/processing/post/ProcessAdditional.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index 234ed43603..adac5f01ea 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -320,7 +320,7 @@ class ProcessAdditional * Password status of the current release. * @var array */ - protected $_passwordStatus; + protected $_passwordStatus = []; /** * Does the current release have a password? @@ -1087,7 +1087,7 @@ protected function _processCompressedData(&$compressedData): bool $this->_debug('ArchiveInfo: Compressed file has a password.'); } $this->_releaseHasPassword = true; - $this->_passwordStatus[] = Releases::PASSWD_RAR; + $this->_passwordStatus = [Releases::PASSWD_RAR]; return false; } @@ -1154,13 +1154,13 @@ protected function _processCompressedFileList(): bool if (isset($file['pass']) && $file['pass'] === true) { $this->_releaseHasPassword = true; - $this->_passwordStatus[] = Releases::PASSWD_RAR; + $this->_passwordStatus = [Releases::PASSWD_RAR]; break; } if ($this->_innerFileBlacklist !== false && preg_match($this->_innerFileBlacklist, $file['name'])) { $this->_releaseHasPassword = true; - $this->_passwordStatus[] = Releases::PASSWD_POTENTIAL; + $this->_passwordStatus = [Releases::PASSWD_POTENTIAL]; break; } @@ -1216,7 +1216,7 @@ protected function _addFileInfo(&$file): void if (ReleaseFile::addReleaseFiles($this->_release->id, $file['name'], $file['size'], $file['date'], $file['pass'], '', $file['crc32'] ?? '')) { $this->_addedFileInfo++; if ((int) $file['pass'] === 1) { - $this->_passwordStatus[] = Releases::PASSWD_RAR; + $this->_passwordStatus = [Releases::PASSWD_RAR]; } if ($this->_echoCLI) { @@ -1231,7 +1231,7 @@ protected function _addFileInfo(&$file): void $this->_debug('Codec spam found, setting release to potentially passworded.'); } $this->_releaseHasPassword = true; - $this->_passwordStatus[] = Releases::PASSWD_POTENTIAL; + $this->_passwordStatus = [Releases::PASSWD_POTENTIAL]; } //Run a PreDB filename check on insert to try and match the release elseif ($file['name'] !== '' && strpos($file['name'], '.') !== 0) { $this->_release['filename'] = $file['name']; @@ -2300,7 +2300,7 @@ protected function _resetReleaseStatus(): void $this->_foundSample = $this->_processThumbnails ? false : true; $this->_foundPAR2Info = false; - $this->_passwordStatus[] = Releases::PASSWD_NONE; + $this->_passwordStatus = [Releases::PASSWD_NONE]; $this->_releaseHasPassword = false; $this->_releaseGroupName = UsenetGroup::getNameByID($this->_release->groups_id);