]> git.mxchange.org Git - friendica.git/commitdiff
Fix workerqueue entries with wrong priority
authorMichael <heluecht@pirati.ca>
Sat, 14 May 2022 06:36:43 +0000 (06:36 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 14 May 2022 06:36:43 +0000 (06:36 +0000)
src/Core/Worker.php
src/Model/Item.php

index 45811d40a7030c7a79d14219282c787e682b3fe0..e29cf765a4fa38c5885798ef396cc0c6a9b8f89a 100644 (file)
@@ -1322,7 +1322,7 @@ class Worker
                $found = DBA::exists('workerqueue', ['command' => $command, 'parameter' => $parameters, 'done' => false]);
                $added = 0;
 
-               if (!in_array($priority, PRIORITIES)) {
+               if (!is_int($priority) || !in_array($priority, PRIORITIES)) {
                        Logger::warning('Invalid priority', ['priority' => $priority, 'command' => $command, 'callstack' => System::callstack(20)]);
                        $priority = PRIORITY_MEDIUM;
                }
index 492442188a0edef784468d1dda0f04c52d568e0c..a1cccb25444a32e871a61862831f0b0ca8b0e8a1 100644 (file)
@@ -725,7 +725,7 @@ class Item
                return GRAVITY_UNKNOWN;   // Should not happen
        }
 
-       public static function insert(array $item, bool $notify = false, bool $post_local = true)
+       public static function insert(array $item, int $notify = 0, bool $post_local = true)
        {
                $orig_item = $item;
 
@@ -739,7 +739,7 @@ class Item
                        $item['protocol'] = Conversation::PARCEL_DIRECT;
                        $item['direction'] = Conversation::PUSH;
 
-                       if (in_array($notify, PRIORITIES)) {
+                       if (is_int($notify) && in_array($notify, PRIORITIES)) {
                                $priority = $notify;
                        }
                } else {