Commit graph

397 commits

Author SHA1 Message Date
MDW
f551727df9
Qual/Sec: Use db->sanitize instead of db->escape when not quoted, fix some quoting (#39286)
* FIX phpstan: Societe::$client (int<0,3>) does not accept -1 (#39244)

Societe::$client is annotated @var int<0,3> (domain 0=no customer,
1=customer, 2=prospect, 3=both) in societe.class.php, but the create
form in societe/card.php pre-set it to -1 as a transient "nothing
pre-selected" placeholder, tripping PHPStan level 10 on develop.

The value is never persisted (save paths compute 0..3) and the only
reader, the switch() building the form, treats -1 and 0 identically via
its default case. Use 0 (the property's own default) so the assignment
matches the declared type. No behavior change.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* Qual: Fix entity handling in bonprelevement.class.php

The variable name 'entities' was changed to 'entity' to better reflect the singular nature of the value being retrieved.
It was also casted to an int instead of using an unquoted db->escape.

* Qual: Improve SQL query construction in company.lib.php

By escaping the concatenated string, injection verification does not identify a false positive.

* Qual: Avoid void positive, sanitize instead of escape

* Qual: Avoid false positive, sanitize instead of escape

* Sec: Fix potential injection with cast to int (timespent_duration)

* Qual: Avoid false positive, sanitize instead of escape

* Qual: Avoid false positive, sanitize instead of escape

* fix: Replace escape() with sanitize() in SQL queries

# FIX: Replace escape() with sanitize() in SQL queries

- Replace escape() with sanitize() in SQL queries to ensure proper SQL injection protection
- Update SQL queries in multiple files to use sanitize() instead of escape()
- Ensure consistent use of sanitize() across the codebase for better security

* fix(sql): Replace escape with sanitize in SQL queries

# FIX: Replace escape with sanitize in SQL queries

- Replace `escape` with `sanitize` in SQL queries to ensure proper SQL injection prevention

* Qual: Improve field escaping/quoting

# Qual: Qual: Improve field escaping/quoting

---------

Co-authored-by: Jam Balaya <jambalaya.pyoncafe@outlook.jp>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 13:00:33 +02:00
MDW
1dcd497c69
Qual: Fix 'SqlInjection' notices (#39219)
# Qual: Fix 'SqlInjection' notices

Batch of 25 files with changes to fix 'SqlInjection' Notices
2026-07-20 02:50:44 +02:00
Frédéric FRANCE
855a00ae09
clean code (#38472)
* clean code

* clean code

* clean code

* clean code

* fix

* clean code

* clean code

* clean code

* clean code

* clean code
2026-06-10 19:31:35 +02:00
Laurent Destailleur
bf432da483 Doc example 2026-05-29 12:16:42 +02:00
MDW
8e2868c291
Qual: Fix PHPStan (array definition) (#38071)
* Qual: Fix PHPStan (array definition)

# Qual: Fix PHPStan (array definition)

More complete array definition for $TNetNeeds argument

* Qual: Update PHPStan baseline

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-05-04 17:36:05 +02:00
MDW
6514e89128
Qual: Update fields array type (#37931)
* Qual: Update fields array type

Propagate the fields array type changes to other classes

* Adjust initialisations of $fields to avoid phpstan notices

* Qual: Fix invalid value for 'index' in $fields

* Fix: notnull in $fields can not be -1

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-04-19 16:10:54 +02:00
Francis Appels
b02f1a4ebf
NEW: Show bom net needs treeview by line position. (#37459)
* New show bom net needs treeview by line position.

* bom_net_needs fix level is also position.

* bom_net_needs position need numeric sort.

* Fix sorting string

* Fix warning

* fix stan/phan

* Fix stan

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-03-12 14:38:31 +01:00
Laurent Destailleur
39d39f475d Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 2026-01-23 17:46:38 +01:00
boudet jean pascal
f9c8164e57
FIX: [BOM] Reset date_creation when cloning a BOM" -m "The creation date of the source object was preserved. This fix ensures the new object gets the current timestamp. (#36898)
Co-authored-by: jpb <jean-pascal.boudet@atm-consulting>
2026-01-19 14:38:13 +01:00
MDW
c39e87d703
Qual: Make $fields covariant, define type for $FIELDS in BankAccounts api (#36188)
* Qual: Make $fields covariant

* Qual: Update BankAccounts class phpDoc ($FIELDS)

# Qual: Update BankAccounts class phpDoc ($FIELDS)

Updated the documentation for the $FIELDS property.
2025-11-09 18:06:58 +01:00
Frédéric FRANCE
9491d880cf
clean code (#36170)
* clean code

* Update bom.class.php

* Update commondocgenerator.class.php

* fix

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-11-09 01:19:31 +01:00
MDW
b925dd6c37
Qual: Make $fields type covariant (phpstan) (#36084)
# Qual: Make $fields type covariant (phpstan)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-11-04 14:16:17 +01:00
Laurent Destailleur
793f48dbff Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-10-16 19:42:43 +02:00
atm-corentin
a4822e466a
remove redundant price2num calls in cost calculations to simplify code (#35743)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-10-15 00:46:57 +02:00
Frédéric FRANCE
6afec608a3
fix CI (#35631)
* fix CI

* fix CI

* fix CI

* fix CI

* fix CI

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code
2025-10-04 13:29:57 +02:00
Frédéric FRANCE
a90c222f73
clean code (#35626)
* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code
2025-10-04 00:07:24 +02:00
VIAL-GOUTEYRON Quentin
049cbbfb4d
Fix MRP: Add hook calculateCostsBomAfter to alter BOM costs (#35465)
* fix doc (#35416)

* fix doc

* Update commonobject.class.php

* Update mo.class.php

* FIX missing entity filter (#35461)

* Add post-processing hook `calculateCostsBomAfter` in BOM cost calculations

---------

Co-authored-by: Frédéric FRANCE <frederic34@users.noreply.github.com>
Co-authored-by: Regis Houssin <regis.houssin@inodbox.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-09-25 11:48:19 +02:00
Frédéric FRANCE
86f20799bc
clean code (#35419)
* clean code

* clean code
2025-09-21 15:32:34 +02:00
ldestailleur
706b9f47d8 Move doc for git commit template 2025-09-20 03:10:33 +02:00
Bradley Jarvis
7e712cd368
Fix sub BOM quantities (#35371)
* FIX: reqursive bom quantities

Correctly handle quantities on BOM recursion. Current behavior is that
sub BOM total quantity is multiplied by parent quantity for that line,
the expected behaviour is that the parent BOM would be including sub BOM
on a per unit base.

* Simplified code

* Update objectline_view.tpl.php

* Update bom.class.php

* Update bom.class.php

* Update bom.class.php

* Update bom.class.php

---------

Co-authored-by: brad <brad@endurotags.com.au>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-09-20 01:00:39 +02:00
Frédéric FRANCE
d6dce86061
clean code (#35379)
* clean code

* clean code

* clean code

* clean code
2025-09-18 11:08:06 +02:00
Frédéric FRANCE
e81d5378cd
clean code contract class (#35245)
* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code contract class

* clean code

* clean code

* clean code

* clean code

* clean code

* fix typo

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2025-09-10 11:13:18 +02:00
ldestailleur
cd7de255bc Fix CI 2025-09-05 14:03:42 +02:00
ldestailleur
3b668903b5 Clean code. Show how to use TRIGGER_PREFIX in modulebuilder template. 2025-09-04 11:30:24 +02:00
Frédéric FRANCE
a1d7b11324
fix doc (#35196) 2025-09-03 12:54:17 +02:00
ldestailleur
a5a947a570 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2025-09-03 12:44:59 +02:00
ldestailleur
78618f8771 Clean code 2025-09-03 12:44:49 +02:00
Pratush Raj
3291d78de8
#35192 (#35193) 2025-09-03 12:41:11 +02:00
Chloe-Moreau-2009
bcbc940cb6
QUAL replace $conf->XXX->dir_output by getMultidiroutput (#34455)
* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

* replace $conf->XXX->dir output by GetMultidir0utput

---------

Co-authored-by: Theobald <f.moreau@theobald-groupe.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-08-02 00:25:10 +02:00
Laurent Destailleur
bf470c4b5d Fix CI 2025-07-05 18:40:14 +02:00
Laurent Destailleur
7d02de2abf Fix CI 2025-07-05 16:04:56 +02:00
Laurent Destailleur
0923600aee Fix CI 2025-07-05 13:12:17 +02:00
Laurent Destailleur
beac067e55 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-07-05 10:46:39 +02:00
Laurent Destailleur
5634483720 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2025-07-05 10:46:06 +02:00
Laurent Destailleur
af6076352c Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2025-07-05 10:44:49 +02:00
Laurent Destailleur
704173f4a6 FIX #34591 FIX #34692 2025-07-05 10:32:59 +02:00
Laurent Destailleur
e034b4b0ef Standardize code 2025-04-24 00:51:47 +02:00
MDW
0cc1aa6d80
Qual: Fix phan notices (asset..compta/paiement) (#33484)
* Qual: Fix phan notices (accountancy, adherents)

* Qual: Fix phan notices (admin)

* Qual: Fix phan notices (asset..compta/paiement)

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-03-16 20:45:04 +01:00
ldestailleur
34ecda6994 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-02-25 02:47:26 +01:00
ldestailleur
030d83145f Merge 2025-02-25 02:44:30 +01:00
Pratush Raj
6acbaf81f2 Fixed: 33178 2025-02-21 19:05:08 +05:30
Laurent Destailleur (aka Eldy)
732f97d73c Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2025-02-05 00:40:06 +01:00
Laurent Destailleur (aka Eldy)
b024b95948 Fix typo 2025-01-09 19:35:01 +01:00
Laurent Destailleur (aka Eldy)
56710ce9b7 FIX CVE-2024-55227 and CVE-2024-55228 CSRF when
MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY is
on (hidden option not on by default)
2025-01-09 19:35:01 +01:00
Laurent Destailleur (aka Eldy)
de321e8f01 Fix typo 2025-01-09 02:01:49 +01:00
Laurent Destailleur (aka Eldy)
c0250e4c91 FIX CVE-2024-55227 CSRF when MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY is
on (hidden option not on by default)
2025-01-08 17:41:45 +01:00
MDW
ec2a1928ba
Qual: Update fields phpdoc to include fields that are defined/used in some cases
# Qual: Update fields phpdoc to include fields that are defined/used in some cases

comment, copytoclipboard, autofocusoncreated are documented and used in some cases for the
$fields definition
2024-12-05 02:36:50 +01:00
Laurent Destailleur
7a195e01b2 Debug v21 - manufacturing cost 2024-12-04 08:42:18 +01:00
Frédéric FRANCE
ead048e1fd
fix calculate costs bom (#31755)
* fix calculate costs bom

* fix calculate costs bom

* Update bom.class.php

* fix

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-15 15:05:51 +01:00
Laurent Destailleur
607f2708fc Rename variables to avoid confusion between id and scale. 2024-11-10 18:09:18 +01:00