Fix CSRF token validation function

Security Fix:
- Changed checkToken() to dolibarr_checkToken()
- Uses the correct Dolibarr CSRF protection function
- Fixes 'Call to undefined function checkToken()' error

The form should now work properly with CSRF protection.
This commit is contained in:
Frank Cools 2025-10-02 18:16:07 +02:00
parent 54d0ceaa03
commit 480d3c5deb

View File

@ -47,7 +47,7 @@ $success = '';
if ($action == 'create') {
// Check CSRF token
if (!checkToken()) {
if (!dolibarr_checkToken()) {
$error = $langs->trans("ErrorCSRFToken");
} elseif (!empty($start_date) && !empty($end_date)) {
// Create the declaration with dates