*
*/
- $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);
* @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);
}
if (defined('LIGHTTPD')) {
- if (!is_array($headers)) {
+ if (empty($headers)) {
$headers = ['Expect:'];
} else {
if (!in_array('Expect:', $headers)) {
}
}
- if ($headers) {
+ if (!empty($headers)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}