diff --git a/ChangeLog b/ChangeLog index 4acd2057833..02d2cef1ab5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1584,6 +1584,17 @@ The following changes may create regressions for some external modules, but were * The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases. +***** ChangeLog for 18.0.10 compared to 18.0.9 ***** + +FIX: autofill price with multicurrency on supplier doc (backport commit 391aca5) (#38028) +FIX: calculate the files count on ECM when add multiple files in one time (#31866) +FIX: #GHSA-hq5j-39f9-qxcv (#37812) +FIX: SQL Injection via Operator Injection in Contract Service List +FIX: #GHSA-crgg-h74r-2m8r (#37636) +FIX: do not print Extrafields in PDF if printable is 0 +FIX: a param must not come from end user entry. + + ***** ChangeLog for 18.0.9 compared to 18.0.8 ***** 100 files changed, 2283 insertions(+), 591 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 41951626822..e8d71e3be74 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -403,7 +403,7 @@ class modSociete extends DolibarrModules 's.code_compta' => "Text", 's.code_compta_fournisseur' => "Text", 's.client' => "Numeric", 's.fournisseur' => "Numeric", 's.address' => "Text", 's.zip' => "Text", 's.town' => "Text", 's.phone' => "Text", 's.email' => "Text", - 't.code' => "List:c_stcomm:libelle:code", + 't.code' => "List:c_typent:libelle:code", 'c.entity' => 'List:entity:label:rowid', 's.entity' => 'List:entity:label:rowid', ); diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 27b31001992..43325f94854 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -293,11 +293,36 @@ class EcmDirectory extends CommonObject /** * Update cache of nb of documents into database * - * @param string $value '+' or '-' or new number + * @param string $value '+' (one more) or '-' (one less) or new number (like '5') or 'database' (recompute from database) * @return int Return integer <0 if KO, >0 if OK */ public function changeNbOfFiles($value) { + global $conf; + + if ($value == 'database') { + $relativepath = $conf->ecm->dir_output . '/' . $this->getRelativePath(); // Ex: dir1/dir2/dir3/ + $relativepath = preg_replace('/^' . preg_quote(DOL_DATA_ROOT, '/') . '/', '', $relativepath); + $relativepath = trim($relativepath, '/'); + + // Get nb file in relative path + $sql = "SELECT COUNT(*) AS nb"; + $sql .= " FROM " . $this->db->prefix() . "ecm_files"; + $sql .= " WHERE filepath = '" . $this->db->escape($relativepath) . "'"; + + dol_syslog(get_class($this) . "::changeNbOfFiles - Get nb file in relative path", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + $this->error = "Error " . $this->db->lasterror(); + return -1; + } else { + $value = 0; + if ($obj = $this->db->fetch_object($resql)) { + $value = (int) $obj->nb; + } + } + } + // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET"; if (preg_match('/[0-9]+/', $value)) {