mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Fix: email clearing in findOrCreateAuthor, htmlspecialchars(null) crash in old(), dead contact_interne field, access_type_id radio clearing
- findOrCreateAuthor: always update email column (pass null when empty/falsy) so clearing an email actually persists - admin/add.php & admin/edit.php old(): add null guard before htmlspecialchars, cast to string - jury-fieldset.php: guard against old() returning array for scalar-checked jury_lecteur keys - formulaire.php: only suppress display_errors in production (not cli-server dev mode) - Removed dead contact_interne field from backoffice form (no DB column, never saved) - Removed dead contactInterne validation from ThesisCreateController - Added "— Non défini" radio option for access_type_id in admin mode for clearing - Fixed strict int-vs-string comparison breaking radio button checked detection
This commit is contained in:
@@ -3,9 +3,12 @@
|
||||
require_once __DIR__ . '/../../../bootstrap.php';
|
||||
require_once __DIR__ . '/../../../src/AdminAuth.php';
|
||||
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_log', APP_ROOT . '/../error.log');
|
||||
// Only suppress display_errors in production (cli-server = dev mode).
|
||||
if (php_sapi_name() !== 'cli-server') {
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_log', APP_ROOT . '/../error.log');
|
||||
}
|
||||
|
||||
AdminAuth::requireLogin();
|
||||
|
||||
|
||||
@@ -41,7 +41,8 @@ function old($key, $default = "") {
|
||||
global $formData;
|
||||
if (!isset($formData[$key])) return $default;
|
||||
if (is_array($formData[$key])) return $formData[$key]; // Return raw array for callers that handle it
|
||||
return htmlspecialchars($formData[$key]);
|
||||
if ($formData[$key] === null) return $default;
|
||||
return htmlspecialchars((string)$formData[$key]);
|
||||
}
|
||||
|
||||
function wasSelected($key, $value) {
|
||||
|
||||
@@ -25,7 +25,8 @@ function old($key, $default = "") {
|
||||
global $formData;
|
||||
if (!isset($formData[$key])) return $default;
|
||||
if (is_array($formData[$key])) return $formData[$key]; // Return raw array for callers that handle it
|
||||
return htmlspecialchars($formData[$key]);
|
||||
if ($formData[$key] === null) return $default;
|
||||
return htmlspecialchars((string)$formData[$key]);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user