diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 76a73e8de05..7c85d9a2fc0 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -157,6 +157,10 @@ if (!empty($tag) && ($unsuscrib == '1')) { header("Content-type: text/html; charset=".$conf->file->character_set_client); + // Security options + header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on) + header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) + print ''; print "\n"; print "\n"; diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index a6512b83a60..d58b6448edb 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -147,16 +147,8 @@ $db->close(); */ function llxHeaderVierge($title, $head = "") { - global $user, $conf, $langs; + top_htmlhead($head, $title); - header("Content-type: text/html; charset=".$conf->file->character_set_client); - print "\n"; - print "
\n"; - print "| '.dolGetFirstLastname($langs->trans("Firstname"), $langs->trans("Lastname")).' | '; - print ''.$langs->trans("Company").' | '."\n"; + print ''.dolGetFirstLastname($langs->trans("Firstname"), $langs->trans("Lastname")).' | '; + print ''.$langs->trans("Company").' | '."\n"; //print_liste_field_titre("DateOfBirth", $_SERVER["PHP_SELF"],"birth",'',$param,$sortfield,$sortorder); // est-ce nécessaire ?? - print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "email", '', $param, '', $sortfield, $sortorder, 'public_'); - print_liste_field_titre("Zip", $_SERVER["PHP_SELF"], "zip", "", $param, '', $sortfield, $sortorder, 'public_'); - print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "town", "", $param, '', $sortfield, $sortorder, 'public_'); - print_liste_field_titre("Photo", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'public_'); + print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "email", '', $param, '', $sortfield, $sortorder, 'left public_'); + print_liste_field_titre("Zip", $_SERVER["PHP_SELF"], "zip", "", $param, '', $sortfield, $sortorder, 'left public_'); + print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "town", "", $param, '', $sortfield, $sortorder, 'left public_'); + print_liste_field_titre("Photo", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center public_'); print "'.$objp->zip.' | '."\n"; print ''.$objp->town.' | '."\n"; if (isset($objp->photo) && $objp->photo != '') { - print ''; + print ' | '; print $form->showphoto('memberphoto', $objp, 64); print ' | '."\n"; } else { diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 01910f71aaf..609ced5f684 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -44,6 +44,10 @@ $usedolheader = 1; // 1 = Test inside a dolibarr page, 0 = Use hard coded header if (empty($usedolheader)) { header("Content-type: text/html; charset=UTF8"); + + // Security options + header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on) + header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) ?> diff --git a/htdocs/public/test/test_badges.php b/htdocs/public/test/test_badges.php index 64ccf82345b..d3ed6476f95 100644 --- a/htdocs/public/test/test_badges.php +++ b/htdocs/public/test/test_badges.php @@ -12,6 +12,16 @@ if ($dolibarr_main_prod) { accessforbidden('Access forbidden when $dolibarr_main_prod is set to 1'); } +/* + * View + */ + +header("Content-type: text/html; charset=UTF8"); + +// Security options +header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on) +header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) + ?> diff --git a/htdocs/public/test/buttons.php b/htdocs/public/test/test_buttons.php similarity index 100% rename from htdocs/public/test/buttons.php rename to htdocs/public/test/test_buttons.php diff --git a/htdocs/public/test/test_csrf.php b/htdocs/public/test/test_csrf.php index 3127a765985..43372d22f15 100644 --- a/htdocs/public/test/test_csrf.php +++ b/htdocs/public/test/test_csrf.php @@ -34,6 +34,11 @@ if ($dolibarr_main_prod) { * View */ +header("Content-type: text/html; charset=UTF8"); + +// Security options +header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on) +header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) ?> This is a form to test if a CSRF exists into a Dolibarr page.
|---|