From 77f2b137b5c76b663afb4640f011ac28762f703a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Apr 2018 19:23:41 +0200 Subject: [PATCH] FIX XSS --- htdocs/user/group/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 52de09d566d..f30567810d8 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -110,9 +110,9 @@ if (empty($reshook)) { setEventMessages($langs->trans("NameNotDefined"), null, 'errors'); $action="create"; // Go back to create page } else { - $object->nom = trim($_POST["nom"]); // For backward compatibility - $object->name = trim($_POST["nom"]); - $object->note = trim($_POST["note"]); + $object->name = trim(GETPOST("nom",'nohtml')); + $object->nom = $object->name; // For backward compatibility + $object->note = trim(GETPOST("nom",'none')); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -193,9 +193,9 @@ if (empty($reshook)) { $object->oldcopy = clone $object; - $object->name = trim($_POST["group"]); + $object->name = trim(GETPOST("group",'nohtml')); $object->nom = $object->name; // For backward compatibility - $object->note = dol_htmlcleanlastbr($_POST["note"]); + $object->note = dol_htmlcleanlastbr(GETPOST("note",'none')); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -258,7 +258,7 @@ if ($action == 'create') print ""; print ''.$langs->trans("Name").''; - print ''; + print ''; // Multicompany if (! empty($conf->multicompany->enabled) && is_object($mc)) @@ -343,7 +343,7 @@ else if (! empty($conf->mutlicompany->enabled)) { print ''.$langs->trans("Name").''; - print ''.$object->name; + print ''.dol_escape_htmltag($object->name); if (empty($object->entity)) { print img_picto($langs->trans("GlobalGroup"),'redstar'); @@ -356,7 +356,7 @@ else { $mc->getInfo($object->entity); print "".''.$langs->trans("Entity").''; - print ''.$mc->label; + print ''.dol_escape_htmltag($mc->label); print "\n"; } @@ -490,7 +490,7 @@ else $genallowed = $user->rights->user->user->creer; $delallowed = $user->rights->user->user->supprimer; - $somethingshown = $formfile->show_documents('usergroup', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); + $somethingshown = $formfile->showdocuments('usergroup', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, null); @@ -520,7 +520,7 @@ else print ''; print ''; - print '\n"; // Multicompany
'.$langs->trans("Name").''; + print ''; print "