Przeglądaj źródła

Fixes constants which contains underscores.

Example: `SSL_VERIFYPEER` would renamed to `SSLVERIFYPEER` which results in the following error: `Couldn't find constant CURLOPT_SSLVERIFYPEER`
Kevin vd Burgt 9 lat temu
rodzic
commit
affaae47a6
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/Ixudra/Curl/Builder.php

+ 2 - 2
src/Ixudra/Curl/Builder.php

@@ -219,7 +219,7 @@ class Builder {
     {
         $results = array();
         foreach( $this->curlOptions as $key => $value ) {
-            $array_key = constant( 'CURLOPT_' . str_replace('_', '', $key) );
+            $array_key = constant( 'CURLOPT_' . $key );
 
             if( $key == 'POST_FIELDS' && is_array( $value ) ) {
                 $results[ $array_key ] = http_build_query( $value, null, '&' );
@@ -231,4 +231,4 @@ class Builder {
         return $results;
     }
 
-}
+}