]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
Merge pull request #10633 from nupplaphil/task/httprequest_optimiziations
[friendica.git] / src / Protocol / DFRN.php
index 3c28aca901d05427aab507d7fbd646529eb8f5b0..141bce54270561107a4234b5a2102f7327baacc7 100644 (file)
@@ -976,7 +976,7 @@ class DFRN
 
                $content_type = ($public_batch ? "application/magic-envelope+xml" : "application/json");
 
-               $postResult = DI::httpRequest()->post($dest_url, $envelope, ["Content-Type: " . $content_type]);
+               $postResult = DI::httpRequest()->post($dest_url, $envelope, ['Content-Type' => $content_type]);
                $xml = $postResult->getBody();
 
                $curl_stat = $postResult->getReturnCode();
@@ -985,7 +985,7 @@ class DFRN
                        return -9; // timed out
                }
 
-               if (($curl_stat == 503) && (stristr($postResult->getHeader(), 'retry-after'))) {
+               if (($curl_stat == 503) && $postResult->inHeader('retry-after')) {
                        return -10;
                }
 
@@ -1978,7 +1978,7 @@ class DFRN
                                        $event_id = Event::store($ev);
                                        Logger::info('Event was stored', ['id' => $event_id]);
 
-                                       $item = Event::getItemArrayForId($event_id, $item);
+                                       $item = Event::getItemArrayForImportedId($event_id, $item);
                                }
                        }
                }