Fix PHP 7.2 incompatibility

This commit is contained in:
Alain Schlesser 2018-09-25 19:02:51 +02:00
parent 75ec5e78f5
commit c612994363
No known key found for this signature in database
GPG key ID: 14D455078E18D81E

View file

@ -61,7 +61,7 @@ class Logger {
if ( ! is_null( $this->start_time ) ) {
$this->time += microtime( true ) - $this->start_time;
}
if ( ! is_null( $this->query_offset ) && isset( $wpdb ) ) {
if ( ! is_null( $this->query_offset ) && isset( $wpdb ) && ! empty( $wpdb->queries ) ) {
for ( $i = $this->query_offset; $i < count( $wpdb->queries ); $i++ ) {
$this->query_time += $wpdb->queries[ $i ][1];
$this->query_count++;