From 0f574579eb71e95969d6dd2b645162016f0c8f1b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 7 Mar 2018 12:27:13 +0100 Subject: [PATCH] Fix: avoid error if type is not numeric --- htdocs/categories/class/categorie.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 46063c0f8c4..a8018e2c104 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1201,6 +1201,8 @@ class Categorie extends CommonObject */ function get_all_categories($type=null, $parent=false) { + if (! is_numeric($type)) $type = $this->MAP_ID[$type]; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " WHERE entity IN (".getEntity('category').")"; if (! is_null($type))