Skip to content

Commit 20f8487

Browse files
authored
Merge pull request #1 from therecluse26/therecluse26-encrypted-job-bugfix
Allow for encrypted command data
2 parents 30cc317 + fc341b3 commit 20f8487

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Queue/RabbitMQQueue.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,11 @@ protected function createMessage($payload, int $attempts = 0): array
525525
}
526526

527527
if (isset($currentPayload['data']['command'])) {
528+
// If the command data is encrypted, decrypt it first before attempting to unserialize
529+
if (in_array(ShouldBeEncrypted::class, class_implements($currentPayload['data']['commandName']))) {
530+
$currentPayload['data']['command'] = decrypt($currentPayload['data']['command']);
531+
}
532+
528533
$commandData = unserialize($currentPayload['data']['command']);
529534
if (property_exists($commandData, 'priority')) {
530535
$properties['priority'] = $commandData->priority;

0 commit comments

Comments
 (0)