Commit graph

155531 commits

Author SHA1 Message Date
MDW
99bc4e8b44
Qual: Fix phan notices (#39354) 2026-08-04 16:40:20 +02:00
bomuux
9d4844009f
/imports/index.php wrongly shows access refused (#39379)
htdocs/imports/index.php wrongly shows access refused when both modules import an export enabled but user only have rights on one of them.
2026-08-04 16:18:47 +02:00
MDW
802050a0e1
Qual: Fix 'SqlInjection' notices (#39232)
# Qual: Fix 'SqlInjection' notices

Batch of 21 files with changes to fix 'SqlInjection' Notices
2026-08-01 23:54:52 +02:00
Maxime Kohlhaas
8e4141cb9e
FIX : Require write permission and check owner for unarchive memo (#39344) 2026-07-31 19:04:39 +02:00
Maxime Kohlhaas
f3387ded9a
FIX : Restrict quickmemo note update to owner or non-private memo (#39343) 2026-07-31 18:26:34 +02:00
Laurent Destailleur
ed57e239b8 Trans 2026-07-31 02:55:36 +02:00
Laurent Destailleur
8d1258490a Fix restore version 2026-07-31 02:49:52 +02:00
Laurent Destailleur
4f3b783e46 Merge branch '24.0' of git@github.com:Dolibarr/dolibarr.git into 24.0 2026-07-31 01:04:59 +02:00
Laurent Destailleur
cdb7694041 Fix autocomplete 2026-07-31 01:04:47 +02:00
Pichinov-Jose
557d79d0bc
FIX supplier product combo does not preselect a product without supplier price ('idprod_ID' value) (#39300)
* 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>

* FIX supplier product combo does not preselect a product without supplier price ('idprod_ID' selected value)

Form::select_produits_fournisseurs() only fills the ajax search input when
the selected value is a supplier price id ((int) > 0). When the value is
'idprod_ID' (product without supplier price for this supplier — the format
documented for the $selected parameter and used by the backtopage of the
product creation popup), nothing was preselected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Add copyright

* chore: retrigger CI (lock check setup canceled by GitHub infra)

---------

Co-authored-by: Jam Balaya <jambalaya.pyoncafe@outlook.jp>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-30 18:49:34 +02:00
Pichinov-Jose
fcf3006ddd
FIX Whole session loses its menus after a login done from inside a dialog popup (#39312)
* 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>

* FIX Whole session loses its menus after a login done from inside a dialog popup

The URLs opened by dolButtonToOpenUrlInDialogPopup() carry
dol_hide_topmenu=1 and dol_hide_leftmenu=1. If the session expires and
the user logs in again from inside the popup iframe, these flags were
stored into $_SESSION at login and applied to every following page: the
user 'loses' the top and left menus for the whole session, until logout.

Do not persist the two hide-menu flags when the login is done in a
dol_openinpopup context.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Jam Balaya <jambalaya.pyoncafe@outlook.jp>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-30 18:48:21 +02:00
Frédéric FRANCE
174af16b66
FIX: Undefined array key "text" in dolGetButtonAction dropdown (#39311)
* 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>

* NEW Accountancy - FEC export - Add constant ACCOUNTING_EXPORT_FEC_ADD_TIMESTAMP to add a timestamp in export file name

* The test on dolibarr_main_restrict_os_commands was moved into
dumpDatabase()

* Fix missing extrafields propagation and object links when creating supplier credit note (#39285)

Co-authored-by: Zakaria Boushaba <z.boushaba@vold.africa>

* NEW Filecheck can show diff of modified files (#39022)

* NEW: Show diff against original file in filecheck integrity report

* NEW: Compare against develop branch for alpha/beta versions in filecheck diff

* NEW: Improve filecheck diff granularity on large files with anchor-based split

* Update version.inc.php

* FIX: Undefined array key "text" in dolGetButtonAction dropdown

Button entries built without a 'text' key (e.g. the subtotals module's
"Add title line"/"Add subtotal line" dropdown) triggered a PHP warning on the multi-button branch, which already guarded every other optional key the same way.

---------

Co-authored-by: Jam Balaya <jambalaya.pyoncafe@outlook.jp>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Co-authored-by: Alexandre SPANGARO <alexandre.spangaro@gmail.com>
Co-authored-by: Alexandre SPANGARO <aspangaro.dolibarr@gmail.com>
Co-authored-by: Zakaria Boushaba <48571684+Boushabazakaria@users.noreply.github.com>
Co-authored-by: Zakaria Boushaba <z.boushaba@vold.africa>
2026-07-30 18:47:32 +02:00
Lucas Marcouiller
624d9c97e5
Fix member subscription with empty date valid (#39310)
* NEW : Add support of customer discount of the invoice in the sell journal

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phan

* Correction phan

* Correction phan

* Correction phan

* FIX #39146 : add SQL structure in llx_societe_perentity

* 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>

* NEW Accountancy - FEC export - Add constant ACCOUNTING_EXPORT_FEC_ADD_TIMESTAMP to add a timestamp in export file name

* The test on dolibarr_main_restrict_os_commands was moved into
dumpDatabase()

* Fix missing extrafields propagation and object links when creating supplier credit note (#39285)

Co-authored-by: Zakaria Boushaba <z.boushaba@vold.africa>

* NEW Filecheck can show diff of modified files (#39022)

* NEW: Show diff against original file in filecheck integrity report

* NEW: Compare against develop branch for alpha/beta versions in filecheck diff

* NEW: Improve filecheck diff granularity on large files with anchor-based split

* Update version.inc.php

* Fix member subscription with empty date valid

* Create migration script 24.0.0-25.0.0.sql

* FIX #39146: Fos thirdparties, Manage fk_account, payment method and payment term per entity if MAIN_COMPANY_PERENTITY_SHARED is set.

* Missign migration file

* Update paymentok.php

---------

Co-authored-by: Kamel Khelifa <kkhelifa@open-dsi.fr>
Co-authored-by: tnegre <tnegre@open-dsi.fr>
Co-authored-by: Jam Balaya <jambalaya.pyoncafe@outlook.jp>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Co-authored-by: Alexandre SPANGARO <alexandre.spangaro@gmail.com>
Co-authored-by: Alexandre SPANGARO <aspangaro.dolibarr@gmail.com>
Co-authored-by: Zakaria Boushaba <48571684+Boushabazakaria@users.noreply.github.com>
Co-authored-by: Zakaria Boushaba <z.boushaba@vold.africa>
Co-authored-by: Frédéric FRANCE <frederic34@users.noreply.github.com>
2026-07-30 18:03:44 +02:00
Laurent Destailleur
689572a332 Fix trans 2026-07-30 17:50:18 +02:00
Laurent Destailleur
403e6b4640 Fix CI 2026-07-30 16:59:25 +02:00
Laurent Destailleur
e9c84e8926 Trans 2026-07-30 13:32:58 +02:00
Laurent Destailleur
f8e5f7f4cc Trans 2026-07-30 11:56:51 +02:00
Laurent Destailleur
7011475563 Prepare release 2026-07-30 11:23:07 +02:00
Laurent Destailleur
9415c5c17b Doc 2026-07-30 11:20:44 +02:00
Laurent Destailleur
9f9bd02de8 Fix setup form 2026-07-29 19:41:58 +02:00
Laurent Destailleur
cbcd1cc14f Fix warning 2026-07-29 18:46:50 +02:00
Laurent Destailleur
3cd3753772 Debug v24 2026-07-29 13:39:19 +02:00
Laurent Destailleur
5811af49c1 Debug v24 2026-07-29 13:35:10 +02:00
Laurent Destailleur
9836f52c29 Add missing type 2026-07-29 13:27:35 +02:00
Laurent Destailleur
7e0f0c54f2 Fix deletion must not use the glob by default. 2026-07-29 13:20:28 +02:00
Laurent Destailleur
5c1cd43e1a Fix delete file function must not use glob. 2026-07-29 13:09:11 +02:00
Laurent Destailleur
b8ca29f832 Fix test that user is allowed on thirdparty on api to get categories -
reported by Sabuhi Mammadov
2026-07-29 12:55:43 +02:00
Laurent Destailleur
616784e85b Fix some users can update payments on not owned invoice - reported by
Sabuhi Mammadov
2026-07-29 12:30:59 +02:00
Laurent Destailleur
ca2c725bb1 Fix use of numeric hostname 2026-07-29 12:16:48 +02:00
Laurent Destailleur
29c85b5eed Adapt phpunit to the new sanitization of restricthtml 2026-07-29 01:14:59 +02:00
Laurent Destailleur
7bf7d71fda More complete list of js blacklist function - credit Jakub Kozub -
jakubk (HackerOne)
2026-07-29 00:51:57 +02:00
Laurent Destailleur
6e4ebb17be More complete list of js blacklist function 2026-07-28 20:49:43 +02:00
Laurent Destailleur
bce5bd4229 Fix preselected user in edit of email sender profiles. 2026-07-28 16:14:31 +02:00
Laurent Destailleur
79b1ffeeff Add oncontentvisibility in list of forbidden keys 2026-07-28 15:25:14 +02:00
Laurent Destailleur
05b9704203 Debug v24 2026-07-27 23:59:46 +02:00
Quentin-Seekness
88c9f5248b
Uniform truncate on order's totals (#39271)
Even if trunc is deprecated in pirce()'s function, we should truncate if it exceeds the MAIN_MAX_DECIMALS_SHOWN, as it is on the total_ttc

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-27 13:38:16 +02:00
MDW
1d295abbef
Qual: Fix Phan notices (#39281)
# Qual: Fix Phan notices

Some phan notices are not reported in ci.

This fixes new ones that appeared:
- Update imap.phan_php to provide IMAP related typing info;
- Add typing info to variables;
- Decleare some variables global (htdocs/admin/dict.php) as reused in function;
- Cast potential null to string;
- Adjust param typing to correspond to default null value (getOnlineSignatureUrl);
- Check that parameter is object as expected by function all (dol_format_address);
2026-07-27 13:03:04 +02:00
MDW
3932cd5853
Qual: Update SQL query variables for situation mode in margin reports (#39282)
# Qual: Update SQL query variables for situation mode in margin reports

In the situation mode, the SQL queries for agentMargins, customerMargins, productMargins, and productMargins tab were updated to use new variable names ($sql_delta_pct and $sql_delta_ht) instead of the old ones ($delta_pct and $delta_ht).

This allows correct analysis by SqlInjection
2026-07-27 13:02:34 +02:00
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
cec87d9425
Qual: Remove unnecessary quotes around integer values in SQL queries (#39290)
* FIX: Do not quote NULL for fk_user_author & fk_element on insert

* Qual: Remove unnecessary quotes around integer values in SQL queries

# Qual: Remove unnecessary quotes around integer values in SQL queries

Removed unnecessary single quotes around integer values in SQL queries across multiple files.
2026-07-27 12:59:14 +02:00
Laurent Destailleur
99ac62d86e The test on dolibarr_main_restrict_os_commands was moved into
dumpDatabase()
2026-07-27 11:39:31 +02:00
Laurent Destailleur
e9cc5499ff Debug v24 2026-07-27 04:28:59 +02:00
Laurent Destailleur
76a83ac9ec Better dol_eval protection - reported by CyberM 2026-07-27 01:19:13 +02:00
Laurent Destailleur
0f6f2fd6c5 Fix possible sql injection in api expensereport - reported by Davide
Saladino
2026-07-24 17:44:31 +02:00
Laurent Destailleur
4a36047716 Try to fix bad decoding of encrypted key with accents (utf8 keys) 2026-07-24 16:21:18 +02:00
Laurent Destailleur
8df0c160c3 Doc 2026-07-24 10:01:56 +02:00
Laurent Destailleur
cad37ed37e Debug v24 2026-07-24 10:00:13 +02:00
Laurent Destailleur
7345c21d51 Prepare final v24 2026-07-24 09:48:48 +02:00
Laurent Destailleur
fdaa30b406 Debug setup install. Show warnings on problems. 2026-07-24 09:47:32 +02:00
Laurent Destailleur
a4d355d24f Fix module param must be sanitized with aZ09arobase - reported by Davide
Saladino
2026-07-24 07:37:34 +02:00