Commit graph

11 commits

Author SHA1 Message Date
Laurent Destailleur
0f6f2fd6c5 Fix possible sql injection in api expensereport - reported by Davide
Saladino
2026-07-24 17:44:31 +02:00
MDW
1693f8a8a4
Qual: Fix 'SqlInjection' notices (#39216)
* Qual: Fix 'SqlInjection' notices

# Qual: Fix 'SqlInjection' notices

Batch of 25 files with changes to fix 'SqlInjection' Notices

* Qual: Enhance SQL injection prevention in CodingPhpTest.php

Improved the SQL injection prevention mechanism in the CodingPhpTest.php file by adding a check for integer and float casts in the IN clause of SQL queries to avoid false positives.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-23 19:06:39 +02:00
Tanguy Chénier
544d8f9bbb
FIX Missing comma in ExpenseReportLine::fetch SQL (#38767)
The SELECT of ExpenseReportLine::fetch() was missing a comma after the
"tcheck_file" column. The concatenated SQL became
"... tcheck_file pjt.rowid as projet_id ..." which is a syntax error, so
the query always failed and fetch() returned -1.

This broke loading a single expense report line, both in the UI (confirm
delete line in expensereport/card.php) and in the REST API
(PUT /expensereports/{id}/lines/{lineid}).

The column is now also qualified with its table alias (fde.) for
consistency with the other columns of the SELECT.

Add a PHPUnit test (ExpenseReportTest::testExpenseReportLineFetch) that
creates an expense report with a line and reloads it: it fails before
the fix and passes after.
2026-06-14 01:12:13 +02:00
Charlène Benke
951a73b79f
New add tcheck_file fields for controling expense report line (#38369)
* Add tcheck_file column to llx_expensereport_det table

* Add tcheck_file column to llx_expensereport_det

* Add tcheck_file property and update SQL queries

Added a new property 'tcheck_file' to track the check status of attached files and updated SQL queries to include this field.

* Update expensereportline.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-05-22 21:21:15 +02:00
Frédéric FRANCE
8fa1df6560
clean code (#35518)
* clean code

* fix

* fix

* clean code
2025-09-28 13:58:30 +02:00
Frédéric FRANCE
bce53ec123
clean code (#35180)
* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* clean code

* fix display

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-09-03 14:49:11 +02:00
MDW
8669993ecf
Qual: Fix phan notices (compta/prel..fichinter) (#33485)
* Qual: Fix phan notices (asset..compta/paiement)

* Qual: Fix phan notices (compta/prel..fichinter)
2025-03-19 15:21:48 +01:00
ldestailleur
5540d8c980 Clean code 2025-03-13 10:09:34 +01:00
Lucas Marcouiller
5f5fc076b5
fix undefined property in expensereportline class (#31854)
Co-authored-by: Hystepik <lmarcouiller@nltechno.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-16 10:55:31 +01:00
Frédéric FRANCE
03fa5617da
move trigger into line class (#31457)
* move trigger into line class

* move trigger into line class

* fix
2024-10-19 01:14:20 +02:00
William Mead
7bf0596f3c
Qual isolate expense report line class to separate file (#30953)
* Moved expense report line class to separate file. Updated requires. Added contributor details.

* Updated PHPDoc

* Fixed PHPDoc
2024-09-23 03:34:00 +02:00