diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index feca9c4f204..74e16f9082d 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -210,7 +210,7 @@ llxHeader("", $langs->trans("Categories"), $helpurl); if ($user->rights->categorie->creer) { // Create or add - if ($action == 'create' || $_POST["addcat"] == 'addcat') + if ($action == 'create' || GETPOST("addcat") == 'addcat') { dol_set_focus('#label'); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2482795147a..0348a01de3f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4174,7 +4174,7 @@ class Form $output .= ''; foreach ($cate_arbo as $key => $value) { - if ($cate_arbo[$key]['id'] == $selected || ($selected == 'auto' && count($cate_arbo) == 1)) + if ($cate_arbo[$key]['id'] == $selected || ($selected === 'auto' && count($cate_arbo) == 1)) { $add = 'selected '; } else {