Skip to content

Commit

Permalink
CURLOPT_HTTPHEADER requires an array.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Nov 13, 2024
1 parent 03d58bd commit 10fbd9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phplib/mapit.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function mapit_call($url, $params, $opts = array(), $errors = array()) {
curl_setopt($mapit_ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($mapit_ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($mapit_ch, CURLOPT_USERAGENT, 'PHP MaPit client');
if (defined('OPTION_MAPIT_API_KEY')) curl_setopt($mapit_ch, CURLOPT_HTTPHEADER, 'X-Api-Key: '. OPTION_MAPIT_API_KEY);
if (defined('OPTION_MAPIT_API_KEY')) curl_setopt($mapit_ch, CURLOPT_HTTPHEADER, ['X-Api-Key: '. OPTION_MAPIT_API_KEY]);
}
if (is_array($params)) $params = join(',', $params);
if (strpos($url, '/'))
Expand Down

0 comments on commit 10fbd9a

Please sign in to comment.