Skip to content

Commit

Permalink
Fixed issue when POST data was given as a nested array for post, patc…
Browse files Browse the repository at this point in the history
…h and put methods
  • Loading branch information
stefangabos committed Dec 4, 2024
1 parent b30cf85 commit 71abfb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Zebra_cURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Read more {@link https://github.com/stefangabos/Zebra_cURL/ here}.
*
* @author Stefan Gabos <[email protected]>
* @version 1.6.3 (last revision: October 03, 2024)
* @version 1.6.4 (last revision: December 04, 2024)
* @copyright © 2013 - 2024 Stefan Gabos
* @license https://www.gnu.org/licenses/lgpl-3.0.txt GNU LESSER GENERAL PUBLIC LICENSE
* @package Zebra_cURL
Expand Down Expand Up @@ -1632,7 +1632,7 @@ public function patch($urls, $callback = '') {
CURLOPT_HEADER => 1,
CURLOPT_NOBODY => 0,
CURLOPT_POST => 0,
CURLOPT_POSTFIELDS => isset($values['data']) ? $values['data'] : '',
CURLOPT_POSTFIELDS => isset($values['data']) ? (is_array($values['data']) ? http_build_query($values['data'], '', '&') : $values['data']) : '',
CURLOPT_BINARYTRANSFER => null,
CURLOPT_HTTPGET => null,
CURLOPT_FILE => null,
Expand Down Expand Up @@ -1849,7 +1849,7 @@ public function post($urls, $callback = '') {
CURLOPT_HEADER => 1,
CURLOPT_NOBODY => 0,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => isset($values['data']) ? $values['data'] : '',
CURLOPT_POSTFIELDS => isset($values['data']) ? (is_array($values['data']) ? http_build_query($values['data'], '', '&') : $values['data']) : '',
CURLOPT_BINARYTRANSFER => null,
CURLOPT_CUSTOMREQUEST => null,
CURLOPT_HTTPGET => null,
Expand Down Expand Up @@ -2085,7 +2085,7 @@ public function put($urls, $callback = '') {
CURLOPT_HEADER => 1,
CURLOPT_NOBODY => 0,
CURLOPT_POST => 0,
CURLOPT_POSTFIELDS => isset($values['data']) ? $values['data'] : '',
CURLOPT_POSTFIELDS => isset($values['data']) ? (is_array($values['data']) ? http_build_query($values['data'], '', '&') : $values['data']) : '',
CURLOPT_BINARYTRANSFER => null,
CURLOPT_HTTPGET => null,
CURLOPT_FILE => null,
Expand Down

0 comments on commit 71abfb4

Please sign in to comment.