From d7dc2d45a4bc1c1cabed53054a3a20601736e182 Mon Sep 17 00:00:00 2001 From: Paul Dechov Date: Mon, 7 May 2018 14:48:18 -0400 Subject: [PATCH] Use simpler function for retrieving last array item Also avoids array dereferencing syntax incompatible with PHP <5.4. --- includes/class-wc-install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index f21c23cc6d1..11a247c872b 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -1079,7 +1079,7 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta ( */ private static function associate_plugin_file( $plugins, $key ) { $path = explode( '/', $key ); - $filename = array_slice( $path, -1 )[0]; + $filename = end( $path ); $plugins[ $filename ] = $key; return $plugins; }