From 62a9dda13d959fd7fb5025407d61ae20f323a701 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sat, 24 Oct 2020 23:14:53 +0200 Subject: [PATCH] Update getCategorySearch function --- app/Models/Category.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Category.php b/app/Models/Category.php index 8bb72c12b..3db19bc71 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -315,11 +315,11 @@ class Category extends Model } } foreach ($cat as $category) { - if ($category !== -1 && self::isParent($category)) { + if (is_numeric($category) && $category !== -1 && self::isParent($category)) { foreach (RootCategory::find($category)->categories as $child) { $categories[] = $child['id']; } - } elseif ($category > 0) { + } elseif (is_numeric($category) && $category > 0) { $categories[] = $category; } }