]> git.mxchange.org Git - friendica.git/commitdiff
Fixing Network::post() caused by wrong argument
authorPhilipp Holzer <admin+github@philipp.info>
Mon, 10 Jun 2019 17:12:00 +0000 (19:12 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Mon, 10 Jun 2019 17:34:16 +0000 (19:34 +0200)
mod/dfrn_confirm.php
src/Util/Network.php

index 7da872f0d06a68aeeaf0e29b29cfee84d1e6444e..9f9684e0936e9b40ede108ac7a00b7903d4d78c6 100644 (file)
@@ -209,7 +209,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
                 *
                 */
 
-               $res = Network::post($dfrn_confirm, $params, null, 120)->getBody();
+               $res = Network::post($dfrn_confirm, $params, [], 120)->getBody();
 
                Logger::log(' Confirm: received data: ' . $res, Logger::DATA);
 
index da44fcc8f3d8665a22000add43ca315d1365fb06..92265e30e6116a8721d8f2b1f4d9db3524e1439f 100644 (file)
@@ -250,7 +250,7 @@ class Network
         * @return CurlResult The content
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function post(string $url, $params, $headers = null, int $timeout = 0, int &$redirects = 0)
+       public static function post(string $url, $params, array $headers = [], int $timeout = 0, int &$redirects = 0)
        {
                $stamp1 = microtime(true);
 
@@ -286,7 +286,7 @@ class Network
                }
 
                if (defined('LIGHTTPD')) {
-                       if (!is_array($headers)) {
+                       if (empty($headers)) {
                                $headers = ['Expect:'];
                        } else {
                                if (!in_array('Expect:', $headers)) {
@@ -295,7 +295,7 @@ class Network
                        }
                }
 
-               if ($headers) {
+               if (!empty($headers)) {
                        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                }