Skip to content

Commit

Permalink
Fix error in PHP8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
magiccart committed Nov 10, 2022
1 parent 1992c65 commit 196f9a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Block/Widget/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public function getCategories()
$categories->addAttributeToSort('level');
}elseif($sortAttribute=='custom'){
$custom_sort= $this->getData('custom_sort');
if(preg_match('/^(\d+,)+\d+$/',$custom_sort)){
if(preg_match('/^(\d+,)+\d+$/', (string) $custom_sort)){
$custom_sort_arr = [];
$categoryIds = explode(',',$categoryIds);
$categoryIds = explode(',', (string) $categoryIds);
$custom_sort_arr = explode(',',$custom_sort);
$custom_sort_arr2 = array_merge(array_diff($custom_sort_arr, $categoryIds), array_diff($categoryIds,$custom_sort_arr));
$custom_sort_arr = array_merge($custom_sort_arr,$custom_sort_arr2);
Expand Down

0 comments on commit 196f9a0

Please sign in to comment.