Fixed type crash when URL passed to network request filters is invalid.
Fixes #42
This commit is contained in:
1 parent
dc88dcce1e
commit
b0584dea0a
2 files changed
+16
-5
No files matched your search
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Mustache.php version to resolve issues on PHP 7.4
|
- Mustache.php version to resolve issues on PHP 7.4
|
||||||
|
- type crash when URL passed to network request filters is invalid
|
||||||
|
|
||||||
## 3.3.1 - 2019-07-02
|
## 3.3.1 - 2019-07-02
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,16 @@ class Http_Collector extends Stopwatch_Collector {
|
|||||||
* @param string $url The request URL.
|
* @param string $url The request URL.
|
||||||
*
|
*
|
||||||
* @return false|array|\WP_Error
|
* @return false|array|\WP_Error
|
||||||
|
*
|
||||||
|
* @psalm-suppress RedundantConditionGivenDocblockType
|
||||||
|
* @noinspection PhpUnusedParameterInspection
|
||||||
*/
|
*/
|
||||||
public function pre_http_request( $false, array $args, string $url ) {
|
public function pre_http_request( $false, $args, $url ) {
|
||||||
|
|
||||||
$this->start( $url, 'http' );
|
if ( $url && is_string( $url ) ) {
|
||||||
$this->callers[ $url ] = wp_debug_backtrace_summary( __CLASS__, 5 );
|
$this->start( $url, 'http' );
|
||||||
|
$this->callers[ $url ] = wp_debug_backtrace_summary( __CLASS__, 5 );
|
||||||
|
}
|
||||||
|
|
||||||
return $false;
|
return $false;
|
||||||
}
|
}
|
||||||
@@ -62,10 +67,15 @@ class Http_Collector extends Stopwatch_Collector {
|
|||||||
* @param string $url The request URL.
|
* @param string $url The request URL.
|
||||||
*
|
*
|
||||||
* @return array|\WP_Error
|
* @return array|\WP_Error
|
||||||
|
*
|
||||||
|
* @psalm-suppress RedundantConditionGivenDocblockType
|
||||||
|
* @noinspection PhpUnusedParameterInspection
|
||||||
*/
|
*/
|
||||||
public function http_api_debug( $response, string $type, $class, array $args, string $url ) {
|
public function http_api_debug( $response, $type, $class, $args, $url ) {
|
||||||
|
|
||||||
$this->stop( $url );
|
if ( $url && is_string( $url ) ) {
|
||||||
|
$this->stop( $url );
|
||||||
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user