2 Commits
Author SHA1 Message Date
Andrey Savchenko d2bece68e5 Added sanity check for invalid priority returned by core
Fixes #9
2017-06-28 14:25:45 +03:00
Andrey Savchenko f50faf6ba6 Added downloads badge to readme. 2016-12-06 21:32:31 +02:00
3 changed files with 11 additions and 0 deletions

No files matched your search

+5
View File
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Unreleased ## Unreleased
## 1.4.3 - 2017-06-28
### Fixed
- sanity check for invalid priority returned by core
## 1.4.2 - 2016-12-02 ## 1.4.2 - 2016-12-02
### Fixed ### Fixed
+1
View File
@@ -1,5 +1,6 @@
# Laps — light WordPress profiler # Laps — light WordPress profiler
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Rarst/laps/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Rarst/laps/?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Rarst/laps/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Rarst/laps/?branch=master)
[![Total Downloads](https://poser.pugx.org/rarst/laps/downloads)](https://packagist.org/packages/rarst/laps)
![Laps screenshot](http://i.imgur.com/zFokmkU.png) ![Laps screenshot](http://i.imgur.com/zFokmkU.png)
+5
View File
@@ -95,6 +95,11 @@ class Laps {
$filter_instance = $wp_filter[ $filter_name ]; $filter_instance = $wp_filter[ $filter_name ];
$priority = $filter_instance instanceof \WP_Hook ? $filter_instance->current_priority() : key( $filter_instance ); $priority = $filter_instance instanceof \WP_Hook ? $filter_instance->current_priority() : key( $filter_instance );
// See https://core.trac.wordpress.org/ticket/41185 on broken priority, but more general sanity check.
if ( empty( self::$events[ $filter_name ][ $priority ] ) ) {
return $input;
}
$event = wp_parse_args( $event = wp_parse_args(
self::$events[ $filter_name ][ $priority ], self::$events[ $filter_name ][ $priority ],
array( array(