From f678cd588714cd14b682ead36598d9ca6529e039 Mon Sep 17 00:00:00 2001 From: ozh Date: Wed, 6 May 2015 22:07:26 +0200 Subject: [PATCH] Remove unnecessary function_exists() spl_object_hash() is PHP 5.2+ --- includes/functions-plugins.php | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/includes/functions-plugins.php b/includes/functions-plugins.php index 2237f2e..fe6a2a6 100644 --- a/includes/functions-plugins.php +++ b/includes/functions-plugins.php @@ -92,25 +92,8 @@ function yourls_filter_unique_id( $hook, $function, $priority ) { // Object Class Calling if ( is_object( $function[0] ) ) { - // Object Class Calling - if ( function_exists('spl_object_hash') ) { - return spl_object_hash($function[0]) . $function[1]; - } else { - $obj_idx = get_class( $function[0] ) . $function[1]; - if ( !isset( $function[0]->_yourls_filters_id ) ) { - if ( false === $priority ) - return false; - $count = isset( $yourls_filters[ $hook ][ $priority ]) ? count( (array)$yourls_filters[ $hook ][ $priority ] ) : 0; - $function[0]->_yourls_filters_id = $count; - $obj_idx .= $count; - unset( $count ); - } else { - $obj_idx .= $function[0]->_yourls_filters_id; - } - return $obj_idx; - } + return spl_object_hash( $function[0] ) . $function[1]; } - // Static Calling else if ( is_string( $function[0] ) ) { return $function[0]. '::' .$function[1]; -- 2.45.0