Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -63,6 +63,11 @@ class _Curl
|
||||
* @brief Data sent
|
||||
*/
|
||||
protected $dataForLog = NULL;
|
||||
|
||||
/**
|
||||
* @brief Headers sent
|
||||
*/
|
||||
protected $headersForLog = [];
|
||||
|
||||
/**
|
||||
* Contructor
|
||||
@@ -212,6 +217,8 @@ class _Curl
|
||||
$extra[] = "{$k}: {$v}";
|
||||
break;
|
||||
}
|
||||
|
||||
$this->headersForLog[ $k ] = "{$k}: {$v}";
|
||||
}
|
||||
|
||||
if ( !empty( $extra ) )
|
||||
@@ -382,7 +389,7 @@ class _Curl
|
||||
/* Log - but because the output can be large, only do this if we explicitly have debug logging enabled */
|
||||
if ( \defined('\IPS\DEBUG_LOG') and \IPS\DEBUG_LOG )
|
||||
{
|
||||
\IPS\Log::debug( "\n\n------------------------------------\ncURL REQUEST: {$this->url}\n------------------------------------\n\n" . var_export( $this->dataForLog, TRUE ) . "\n\n------------------------------------\nRESPONSE\n------------------------------------\n\n" . $output, 'request' );
|
||||
\IPS\Log::debug( "\n\n------------------------------------\ncURL REQUEST: {$this->url}\n------------------------------------\n\n" . implode( "\n", $this->headersForLog ) . "\n\n" . var_export( $this->dataForLog, TRUE ) . "\n\n------------------------------------\nRESPONSE\n------------------------------------\n\n" . $output, 'request' );
|
||||
}
|
||||
|
||||
/* Errors? */
|
||||
|
||||
@@ -232,9 +232,11 @@ class _Sockets
|
||||
$request = mb_strtoupper( $method ) . ' /' . ltrim( $location, '/' ) . " HTTP/{$this->httpVersion}\r\n";
|
||||
$request .= "Host: {$this->url->data['host']}" . ( isset( $this->url->data['port'] ) ? ":{$this->url->data['port']}" : '' ) . "\r\n";
|
||||
|
||||
$headersForLog = [];
|
||||
foreach ( $this->headers as $k => $v )
|
||||
{
|
||||
$request .= "{$k}: {$v}\r\n";
|
||||
$headersForLog[ $k ] = "{$k}: {$v}";
|
||||
}
|
||||
|
||||
$request .= "Connection: Close\r\n";
|
||||
@@ -264,7 +266,7 @@ class _Sockets
|
||||
/* Log - but because the output can be large, only do this if we explicitly have debug logging enabled */
|
||||
if ( \defined('\IPS\DEBUG_LOG') and \IPS\DEBUG_LOG )
|
||||
{
|
||||
\IPS\Log::debug( "\n\n------------------------------------\nSOCKETS REQUEST: {$this->url}\n------------------------------------\n\n{$request}\n\n------------------------------------\nRESPONSE\n------------------------------------\n\n" . $response, 'request' );
|
||||
\IPS\Log::debug( "\n\n------------------------------------\nSOCKETS REQUEST: {$this->url}\n------------------------------------\n\n" . implode( "\n", $headersForLog ) . "\n\n{$request}\n\n------------------------------------\nRESPONSE\n------------------------------------\n\n" . $response, 'request' );
|
||||
}
|
||||
|
||||
/* Interpret response */
|
||||
|
||||
@@ -278,4 +278,15 @@ class _Response
|
||||
|
||||
return $queryString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this response successful ? Was the statuscode between 200 and 300
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSuccessful(): bool
|
||||
{
|
||||
/* Return if we have received a 2xx response code */
|
||||
return $this->httpResponseCode >= 200 && $this->httpResponseCode < 300;
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,11 @@ class _Url
|
||||
*/
|
||||
const PROTOCOL_RELATIVE = 3;
|
||||
|
||||
/**
|
||||
* @brief Use no protocol at all!
|
||||
*/
|
||||
const PROTOCOL_WITHOUT = 4;
|
||||
|
||||
/**
|
||||
* @brief Scheme component
|
||||
*/
|
||||
@@ -781,6 +786,9 @@ class _Url
|
||||
case static::PROTOCOL_RELATIVE:
|
||||
$url = '//' . mb_substr( $url, mb_strpos( $url, '://' ) + 3 );
|
||||
break;
|
||||
case static::PROTOCOL_WITHOUT:
|
||||
$url = mb_substr( $url, mb_strpos( $url, '://' ) + 3 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,11 +26,6 @@ class _Useragent
|
||||
* @brief Search engine spider?
|
||||
*/
|
||||
public $spider = FALSE;
|
||||
|
||||
/**
|
||||
* @brief Invision Community mobile app?
|
||||
*/
|
||||
public $ipsApp = FALSE;
|
||||
|
||||
/**
|
||||
* @brief Browser name
|
||||
@@ -110,7 +105,6 @@ class _Useragent
|
||||
|
||||
$this->browser = 'InvisionCommunityApp';
|
||||
$this->browserVersion = $matches[1];
|
||||
$this->ipsApp = $matches[2];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user