diff --git a/catalog/admin/includes/application_top.php b/catalog/admin/includes/application_top.php index c3e838d1b..617f9bc24 100644 --- a/catalog/admin/includes/application_top.php +++ b/catalog/admin/includes/application_top.php @@ -219,7 +219,7 @@ if (tep_not_null($cPath)) { $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); - $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; + $current_category_id = end($cPath_array); } else { $current_category_id = 0; } diff --git a/catalog/includes/application_top.php b/catalog/includes/application_top.php index 35a209208..7d4c68c79 100644 --- a/catalog/includes/application_top.php +++ b/catalog/includes/application_top.php @@ -408,7 +408,7 @@ if ( !empty($cPath) ) { $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); - $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; + $current_category_id = end($cPath_array); } else { $current_category_id = 0; }