Merge pull request #14004 from annando/warning

Fix "Undefined variable $success"
This commit is contained in:
Hypolite Petovan 2024-03-16 08:15:42 +00:00 committed by GitHub
commit c81a47c764
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -338,16 +338,13 @@ class Delivery
if ($public_dfrn) { if ($public_dfrn) {
Logger::info('Relay delivery to ' . $contact['url'] . ' with guid ' . $target_item['guid'] . ' returns ' . $deliver_status); Logger::info('Relay delivery to ' . $contact['url'] . ' with guid ' . $target_item['guid'] . ' returns ' . $deliver_status);
if ($cmd == Delivery::POST) { $success = ($deliver_status >= 200) && ($deliver_status <= 299);
if (($deliver_status >= 200) && ($deliver_status <= 299)) {
Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol);
GServer::setProtocol($contact['gsid'] ?? 0, $protocol); if ($cmd == Delivery::POST) {
$success = true; Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol);
} else { GServer::setProtocol($contact['gsid'] ?? 0, $protocol);
Post\DeliveryData::incrementQueueFailed($target_item['uri-id']); } else {
$success = false; Post\DeliveryData::incrementQueueFailed($target_item['uri-id']);
}
} }
return $success; return $success;
} }