From a25ea27c6b59c13795caaf78ddb074412fedd549 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Mon, 13 Jan 2025 21:25:36 +0100 Subject: [PATCH 01/10] Debug v21 --- .../class/conferenceorboothattendee.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 8512701a0bb..8a7fd4a3b91 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -489,9 +489,9 @@ class ConferenceOrBoothAttendee extends CommonObject if (count($filter) > 0) { foreach ($filter as $key => $value) { if ($key == 't.rowid' || $key == 't.fk_soc' || $key == 't.fk_project' || $key == 't.fk_actioncomm') { - $sqlwhere[] = $key.'='.((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { - $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; + $sqlwhere[] = $this->db->sanitize($key).' = '.((int) $value); + } elseif (!empty($this->fields[$key]) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; } elseif (strpos($value, '%') === false) { From 11d4b973e04727848bfd6d914505f5c89ab9012d Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 14 Jan 2025 10:35:44 +0100 Subject: [PATCH 02/10] Add log --- .../modules/security/generate/modGeneratePassNone.class.php | 2 ++ .../modules/security/generate/modGeneratePassPerso.class.php | 2 ++ .../modules/security/generate/modGeneratePassStandard.class.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index e5f1f77c00c..40817c5ca09 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -98,6 +98,8 @@ class modGeneratePassNone extends ModeleGenPassword */ public function validatePassword($password) { + dol_syslog("modGeneratePassNone::validatePassword"); + return 1; } } diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index de7096bb176..a11f37e4237 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -221,6 +221,8 @@ class modGeneratePassPerso extends ModeleGenPassword $this->initAll(); // For the case this method is called alone + dol_syslog("modGeneratePassPerso::validatePassword"); + $password_a = preg_split('//u', $password, 0, PREG_SPLIT_NO_EMPTY); $maj = preg_split('//u', $this->Maj, 0, PREG_SPLIT_NO_EMPTY); $num = preg_split('//u', $this->Nb, 0, PREG_SPLIT_NO_EMPTY); diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index 53f40260dbc..c363f1c050b 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -125,6 +125,8 @@ class modGeneratePassStandard extends ModeleGenPassword { global $langs; + dol_syslog("modGeneratePassStandard::validatePassword"); + if (dol_strlen($password) < $this->length2) { $langs->load("other"); $this->error = $langs->trans("YourPasswordMustHaveAtLeastXChars", $this->length2); From ec639e13555d487d4b25432ba13eada1a9ad2593 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 14 Jan 2025 10:44:46 +0100 Subject: [PATCH 03/10] Fix trans --- htdocs/langs/en_US/website.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 63725bae5cc..b839978b0a9 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -307,7 +307,7 @@ yourCompanyInformation=Your company information emailAlreadyRegistered=This email is already registered. firstnameContainsLettersOnly=Firstname must contain letters and spaces only lastnameContainsLettersOnly=Lastname must contain letters and spaces only -passwordCriteria=Password must meet the following criteria:
- 12 characters
- 1 uppercase letter
- 1 digit
- No special characters
- Avoid repeating characters more than 3 times
+passwordCriteria=Password must meet the following criteria:
- At least 12 characters
- At lest 1 uppercase letter
- At least 1 digit
- At last 1 special characters
- Avoid repeating characters more than 3 times
errorOccurred=An error has occurred. accountCreation=Create an account errorsOccurred=There are %s error%s From 003424f6cccdae09e8eb7f162f75c663c3562f4d Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 13 Jan 2025 02:10:37 +0100 Subject: [PATCH 04/10] Fix: Correct $search_ref typo into $search_ref_ext --- htdocs/contact/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 48d54d40f5f..9661927d240 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -12,7 +12,7 @@ * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Benjamin Falière * * This program is free software; you can redistribute it and/or modify @@ -368,7 +368,7 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $search_all = ""; $search_id = ''; - $search_ref = ''; + $search_ref_ext = ''; $search_firstlast_only = ""; $search_lastname = ""; $search_firstname = ""; @@ -866,8 +866,8 @@ if ($search_all != '') { if ($search_id > 0) { $param .= "&search_id=".((int) $search_id); } -if ($search_ref) { - $param .= "&search_ref=".urlencode($search_ref); +if ($search_ref_ext) { + $param .= "&search_ref_ext=".urlencode($search_ref_ext); } if ($search_lastname != '') { $param .= '&search_lastname='.urlencode($search_lastname); From 5701d5c6f67e130d60dd8274c9aeb7280eaf8418 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 14 Jan 2025 12:02:52 +0100 Subject: [PATCH 05/10] Debug v21 --- .../eventorganization/class/conferenceorbooth.class.php | 2 +- htdocs/public/eventorganization/attendee_new.php | 4 ++-- htdocs/public/eventorganization/subscriptionok.php | 2 +- htdocs/public/project/suggestbooth.php | 4 ++-- htdocs/public/project/suggestconference.php | 4 ++-- htdocs/public/project/viewandvote.php | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 2defceeee72..12245ab9643 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -291,7 +291,7 @@ class ConferenceOrBooth extends ActionComm $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.urlencode((string) ($id)).'&type=conf'; - $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.$id, '2'); + $encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $id), 'md5'); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); /*$this->fields['pubregister'] = array('type'=>'url', 'label'=>$langs->trans("PublicAttendeeSubscriptionPage"), 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1); diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index d3099bbc36b..70a22f644e4 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -362,7 +362,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // If the registration has already been paid for this attendee if (!empty($confattendee->date_subscription) && !empty($confattendee->amount)) { - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'master'); + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); $mesg = $langs->trans("RegistrationAndPaymentWereAlreadyRecorded", $email); @@ -698,7 +698,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); header("Location: ".$redirection); diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index a1fe0017a3a..5b3be5058eb 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -81,7 +81,7 @@ $error = 0; // Security check $id = GETPOSTINT("id"); $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeyreceived != $securekeytocompare) { print $langs->trans('MissingOrBadSecureKey'); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 949bb286c48..9247e6d9159 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -94,7 +94,7 @@ if ($resultproject < 0) { // Security check $securekeyreceived = GETPOST('securekey', 'alpha'); -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'md5'); +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -550,7 +550,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; header("Location: ".$redirection); exit; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index fcc9dfc6025..e3ddf9c4260 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -94,7 +94,7 @@ if ($resultproject < 0) { // Security check $securekeyreceived = GETPOST('securekey', 'alpha'); -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'md5'); +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -486,7 +486,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he if (!$error) { $db->commit(); - $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, '2'); + $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); header("Location: ".$redirection); exit; diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 5b9404e2515..250a7b4c5df 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -81,7 +81,7 @@ $error = 0; $action = GETPOST('action', 'aZ09'); $id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 'md5'); +$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.((int) $id), 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -173,10 +173,10 @@ while ($i < $db->num_rows($result)) { */ // Get vote result -$idvote = GETPOST("vote"); -$hashedvote = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'vote'.$idvote); +$idvote = GETPOSTINT("vote"); +$hashedvote = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'vote'.$idvote); -if (strlen($idvote)) { +if ($idvote > 0) { if (in_array($hashedvote, $listofvotes)) { // Has already voted $votestatus = 'ko'; From 24c482b1505356b5a755eb604185b9dc9722e59e Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 14 Jan 2025 16:51:03 +0100 Subject: [PATCH 06/10] css --- htdocs/compta/facture/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a17d7309b15..238121bb533 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1415,7 +1415,7 @@ if (getDolGlobalString('MAIN_VIEW_LINE_NUMBER_IN_LIST')) { } // Ref if (!empty($arrayfields['f.ref']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -1439,7 +1439,7 @@ if (!empty($arrayfields['f.type']['checked'])) { } //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. // @phan-suppress-next-line PhanPluginSuspiciousParamOrder - print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); + print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth75'); print ''; } // Invoice Subtype @@ -2505,7 +2505,7 @@ if ($num > 0) { // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; + print ''; if ($userstatic->id) { print $userstatic->getNomUrl(-1); } else { From 800d16bc187715fde158bdab5cd7d71e9520417e Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 14 Jan 2025 16:57:14 +0100 Subject: [PATCH 07/10] Doc --- htdocs/core/class/doleditor.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 030713957a3..31297131479 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -103,7 +103,7 @@ class DolEditor * @param string $toolbarname Name of the toolbar set to use ('dolibarr_details[_encoded]'=the less featured, 'dolibarr_notes[_encoded]' for notes content, 'dolibarr_mailings[_encoded]' for emailing content, 'dolibarr_readonly'). * @param string $toolbarlocation Deprecated. Not used * @param bool $toolbarstartexpanded Bar is visible or not at start - * @param bool|int $uselocalbrowser Enabled to add links to local object with a local media filemanager. If false, only external images URL can be added into content, or images saved inline with src="data:..." with a cut/paste. + * @param bool|int $uselocalbrowser Enabled to add links to local object with a local media filemanager. -1=auto, false=only external images URL can be added into content, or images saved inline with src="data:..." with a cut/paste. * @param bool|int|string $okforextendededitor 1 or True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". * @param int $rows Size of rows for textarea tool From 258411e8707c29935e232b837a8babfe0523d5f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Jan 2025 22:05:08 +0100 Subject: [PATCH 08/10] Debug v21 --- htdocs/commande/class/commande.class.php | 4 ++-- htdocs/core/customreports.php | 11 ++++++----- htdocs/core/lib/customreports.lib.php | 10 ++++++++-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a7f395116b0..630e9fab8d7 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -336,7 +336,7 @@ class Commande extends CommonOrder 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 185), 'date_livraison' => array('type' => 'date', 'label' => 'DateDeliveryPlanned', 'enabled' => 1, 'visible' => -1, 'position' => 190, 'csslist' => 'nowraponall'), 'fk_shipping_method' => array('type' => 'integer', 'label' => 'ShippingMethod', 'enabled' => 1, 'visible' => -1, 'position' => 195), - 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'Fk warehouse', 'enabled' => 'isModEnabled("stock")', 'visible' => -1, 'position' => 200), + 'fk_warehouse' => array('type' => 'integer:Entrepot:product/stock/class/entrepot.class.php', 'label' => 'DefaultWarehouse', 'enabled' => 'isModEnabled("stock")', 'visible' => -1, 'position' => 200, 'nodepth' => 1), 'fk_availability' => array('type' => 'integer', 'label' => 'Availability', 'enabled' => 1, 'visible' => -1, 'position' => 205), 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 210), //'fk_delivery_address' =>array('type'=>'integer', 'label'=>'DeliveryAddress', 'enabled'=>1, 'visible'=>-1, 'position'=>215), @@ -856,7 +856,7 @@ class Commande extends CommonOrder */ public function cancel($idwarehouse = -1) { - global $conf, $user, $langs; + global $user, $langs; $error = 0; diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 59a9f25598c..f0f1cd22712 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -32,7 +32,7 @@ * include DOL_DOCUMENT_ROOT.'/core/customreports.php'; */ - /** +/** * @var Conf $conf * @var DoliDB $db * @var HookManager $hookmanager @@ -322,6 +322,7 @@ $HH = substr($langs->trans("Hour"), 0, 1).substr($langs->trans("Hour"), 0, 1); $MI = substr($langs->trans("Minute"), 0, 1).substr($langs->trans("Minute"), 0, 1); $SS = substr($langs->trans("Second"), 0, 1).substr($langs->trans("Second"), 0, 1); +$arrayoffilterfields = array(); $arrayofmesures = array(); $arrayofxaxis = array(); $arrayofgroupby = array(); @@ -375,6 +376,10 @@ foreach ($arrayoftype as $key => $val) { } } +$count = 0; +$arrayoffilterfields = fillArrayOfFilterFields($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayoffilterfields, 0, $count); +$arrayoffilterfields = dol_sort_array($arrayoffilterfields, 'position', 'asc', 0, 0, 1); + $count = 0; $arrayofmesures = fillArrayOfMeasures($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofmesures, 0, $count); $arrayofmesures = dol_sort_array($arrayofmesures, 'position', 'asc', 0, 0, 1); @@ -387,10 +392,6 @@ $count = 0; $arrayofgroupby = fillArrayOfGroupBy($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayofgroupby, 0, $count); $arrayofgroupby = dol_sort_array($arrayofgroupby, 'position', 'asc', 0, 0, 1); -$count = 0; -$arrayoffilterfields = fillArrayOfFilterFields($object, 't', $langs->trans($newarrayoftype[$objecttype]['label']), $arrayoffilterfields, 0, $count); -$arrayoffilterfields = dol_sort_array($arrayoffilterfields, 'position', 'asc', 0, 0, 1); - // Check parameters if ($action == 'viewgraph') { diff --git a/htdocs/core/lib/customreports.lib.php b/htdocs/core/lib/customreports.lib.php index 553e3f3681b..574faafeabb 100644 --- a/htdocs/core/lib/customreports.lib.php +++ b/htdocs/core/lib/customreports.lib.php @@ -523,10 +523,12 @@ function fillArrayOfFilterFields($object, $tablealias, $labelofobject, &$arrayof { global $langs, $extrafields, $db; + $MAXLEVEL = 2; + if (empty($object)) { // Protection against bad use of method return array(); } - if ($level >= 3) { // Limit scan on 2 levels max + if ($level > $MAXLEVEL) { // Limit scan on 2 levels max return $arrayoffields; } @@ -612,7 +614,11 @@ function fillArrayOfFilterFields($object, $tablealias, $labelofobject, &$arrayof if (class_exists($newobject)) { $tmpobject = new $newobject($db); $count++; - $arrayoffields = fillArrayOfFilterFields($tmpobject, $tablealias.'__'.$key, $langs->trans($val['label']), $arrayoffields, $level + 1, $count, $tablepath); + if (!empty($val['nodepth'])) { + $arrayoffields = fillArrayOfFilterFields($tmpobject, $tablealias.'__'.$key, $langs->trans($val['label']), $arrayoffields, $MAXLEVEL, $count, $tablepath); + } else { + $arrayoffields = fillArrayOfFilterFields($tmpobject, $tablealias.'__'.$key, $langs->trans($val['label']), $arrayoffields, $level + 1, $count, $tablepath); + } } else { print 'For property '.$object->element.'->'.$key.', type="'.$val['type'].'": Failed to find class '.$newobject." in file ".$tmptype[2]."
\n"; } From 41bfe889a16c221c685558d481084d8c6f3b8499 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 15 Jan 2025 11:40:37 +0100 Subject: [PATCH 09/10] Try fix br into custom css --- htdocs/admin/ihm.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index af9b9ff5eec..ede222b86f3 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -325,7 +325,10 @@ if ($action == 'update') { if ($mode == 'css') { //file_put_contents(DOL_DATA_ROOT.'/admin/customcss.css', $data); //dol_chmod(DOL_DATA_ROOT.'/admin/customcss.css'); - dolibarr_set_const($db, "MAIN_IHM_CUSTOM_CSS", GETPOST('MAIN_IHM_CUSTOM_CSS', 'restricthtml'), 'chaine', 0, '', $conf->entity); + $csscontent = GETPOST('MAIN_IHM_CUSTOM_CSS', 'restricthtml'); + $csscontent = dol_string_nohtmltag($csscontent, 2); + + dolibarr_set_const($db, "MAIN_IHM_CUSTOM_CSS", $csscontent, 'chaine', 0, '', $conf->entity); } $_SESSION["mainmenu"] = ""; // The menu manager may have changed From 0cf6b8b8a4bf0c53fb1ffac01753241108a26ea2 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 15 Jan 2025 11:40:39 +0100 Subject: [PATCH 10/10] Try fix br into custom css