diff --git a/TODO.md b/TODO.md index 132cfd9..2f5f255 100644 --- a/TODO.md +++ b/TODO.md @@ -437,6 +437,8 @@ Goal: rename the tables and column to the canonical M2M pattern (`tags`, `thesis `Database::setThesisLanguages()`, `setThesisFormats()`, `setThesisTags()` following the delete-then-reinsert pattern of `setThesisJury()`; `formulaire.php` and `edit.php` updated. +- [x] Fix `fgetcsv()` deprecation warnings in `import.php` - added explicit `$escape = ''` parameter to all 5 calls +- [x] Run all pending DB migrations (001–006) on `storage/posterg.db` - `tags`/`thesis_tags` tables now exist - [ ] **`RateLimit` uses per-file JSON on disk** - reads, writes, and `glob()`s the filesystem on every public request. For a low-traffic art-school site this is fine, but it creates a write-on-every-hit pattern. Consider switching to APCu (if available) or SQLite (single INSERT) diff --git a/public/admin/import.php b/public/admin/import.php index 154d1cf..237ed8f 100644 --- a/public/admin/import.php +++ b/public/admin/import.php @@ -48,10 +48,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) { } // Skip first two rows (empty and headers) - fgetcsv($handle); // Empty row - $headers = fgetcsv($handle); // Header row - fgetcsv($handle); // Description row - $headers = fgetcsv($handle); // Actual column names + fgetcsv($handle, 0, ',', '"', ''); // Empty row + $headers = fgetcsv($handle, 0, ',', '"', ''); // Header row + fgetcsv($handle, 0, ',', '"', ''); // Description row + $headers = fgetcsv($handle, 0, ',', '"', ''); // Actual column names // Map CSV columns $columnMap = [ @@ -99,7 +99,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) { // Process each row $lineNumber = 5; // Start after headers - while (($row = fgetcsv($handle)) !== false) { + while (($row = fgetcsv($handle, 0, ',', '"', '')) !== false) { $lineNumber++; // Skip empty rows diff --git a/storage/posterg.db b/storage/posterg.db index a4fd669..67d5c98 100644 Binary files a/storage/posterg.db and b/storage/posterg.db differ