Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -69,7 +69,7 @@ class _Curl
|
||||
* @param bool|int $followRedirects Automatically follow redirects? If a number is provided, will follow up to that number of redirects
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( $url, $timeout, $httpVersion, $followRedirects )
|
||||
public function __construct( $url, $timeout=5, $httpVersion=NULL, $followRedirects=TRUE )
|
||||
{
|
||||
/* Init */
|
||||
$this->url = $url;
|
||||
@@ -272,6 +272,22 @@ class _Curl
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle SSL checks
|
||||
*
|
||||
* @param boolean $value True will enable SSL checks, false will disable them
|
||||
* @return \IPS\Http\Request\Socket
|
||||
*/
|
||||
public function sslCheck( $value=TRUE )
|
||||
{
|
||||
curl_setopt_array( $this->curl, array(
|
||||
CURLOPT_SSL_VERIFYHOST => ( $value ) ? 2 : FALSE,
|
||||
CURLOPT_SSL_VERIFYPEER => (boolean) $value
|
||||
) );
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic Method: __call
|
||||
* Used for other HTTP methods (like PUT and DELETE)
|
||||
@@ -331,7 +347,7 @@ class _Curl
|
||||
}
|
||||
|
||||
/* If this is FTP we need to fudge the headers a little */
|
||||
if( $this->url->data['scheme'] == 'ftp' )
|
||||
if( isset( $this->url->data['scheme'] ) and $this->url->data['scheme'] == 'ftp' )
|
||||
{
|
||||
$output = "HTTP/1.1 200 OK\nFTP: True\r\n\r\n" . $output;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user