From c1a389dc17bec503b20cc8668053bf3cce1266c8 Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Wed, 9 Jan 2019 19:04:15 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20fatal=20error=20when=20HTTP=20request?= =?UTF-8?q?=20is=20pre=E2=80=93filtered.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ laps.php | 2 +- src/Record/Collector/Http_Collector.php | 10 +++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2688699..dd415b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +## 3.0.1 - 2019-01-09 + +### Fixed +- fatal error when HTTP request is pre–filtered + ## 3.0 - 2018-12-28 ### Added diff --git a/laps.php b/laps.php index 7289513..3c4ea9f 100644 --- a/laps.php +++ b/laps.php @@ -5,7 +5,7 @@ Plugin URI: https://github.com/Rarst/laps Description: Light WordPress profiler. Author: Andrey “Rarst” Savchenko -Version: 3.0 +Version: 3.0.1 Author URI: https://www.rarst.net/ Text Domain: laps Domain Path: /lang diff --git a/src/Record/Collector/Http_Collector.php b/src/Record/Collector/Http_Collector.php index 43e3c9b..3374f56 100644 --- a/src/Record/Collector/Http_Collector.php +++ b/src/Record/Collector/Http_Collector.php @@ -35,16 +35,16 @@ public function __construct( Stopwatch $stopwatch ) { /** * Capture start time of HTTP request * - * @param boolean $false Whether to preempt an HTTP request's return value. Default false. - * @param array $args HTTP request arguments. - * @param string $url The request URL. + * @param false|array|\WP_Error $false Whether to preempt an HTTP request's return value. Default false. + * @param array $args HTTP request arguments. + * @param string $url The request URL. * * @return boolean */ - public function pre_http_request( bool $false, array $args, string $url ): bool { + public function pre_http_request( $false, array $args, string $url ) { $this->start( $url, 'http' ); - $this->callers[ $url ] = wp_debug_backtrace_summary( __CLASS__, 5, true ); + $this->callers[ $url ] = wp_debug_backtrace_summary( __CLASS__, 5 ); return $false; }