From 9f7be989c2f4150ec5327a5ae784fe69fb609884 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Tue, 6 Jul 2021 17:38:37 +0200 Subject: [PATCH 01/11] FIX 13.0 - fatal - missing inclusion of ajax.lib.php for calling `ajax_autocompleter()` --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 945897856f2..1019e9623e4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1118,6 +1118,7 @@ class Form if (!empty($conf->use_javascript_ajax) && !empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && !$forcecombo) { + require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; // No immediate load of all database $placeholder = ''; if ($selected && empty($selected_input_value)) From 2f250799813e7e4faa65cde9e137b420a6ece1e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jul 2021 14:38:52 +0200 Subject: [PATCH 02/11] Fix CSRF token generation must be fast, can have low entropy. --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2301ca75161..df61e752f5c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -420,7 +420,7 @@ if (!defined('NOTOKENRENEWAL')) { if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken']; // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] - $token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number + $token = dol_hash(uniqid(mt_rand(), false), 'md5'); // Generates a hash of a random number. We don't need a secured hash, just a changing random value. $_SESSION['newtoken'] = $token; dol_syslog("NEW TOKEN generated by : " . $_SERVER['PHP_SELF'], LOG_DEBUG); } From 4e77a0d16a4b46314fc13a6c5d70d7cd179a162b Mon Sep 17 00:00:00 2001 From: altairis-noe Date: Thu, 8 Jul 2021 15:55:07 +0200 Subject: [PATCH 03/11] don't display custom masks if they are not used --- htdocs/product/card.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 3d5afd1b16c..5b8c431d65d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1649,21 +1649,30 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '