Files
xamxam/TODO.md
Pontoporeia 38dc8de9d8 feat: obfuscate all email addresses and mailto links as HTML entities
Added EmailObfuscator class (src/EmailObfuscator.php) that converts
email addresses to HTML decimal entities (e.g. foo@...)
so browsers render them correctly but bots and scrapers see gibberish.

Methods:
- email($addr): obfuscate for display in HTML content
- mailto($addr): return obfuscated mailto: href
- obfuscateHtml($html): post-process rendered HTML to obfuscate all
  mailto: links (used after Parsedown/Markdown rendering)

Applied to:
- partage/index.php: mailto link at top + error scenarios via _flash_contact
  flag rendered in form.php (outside htmlspecialchars to avoid double-escape)
- admin/acces.php: request email mailto links
- admin/file-access.php: request email mailto links
- public/about.php: contact email mailto links
- public/tfe.php: author contact mailto links
- AboutController: Parsedown output post-processing
- LicenceController: Parsedown output post-processing
- Dispatcher::render(): require_once EmailObfuscator for all public views

Also fixed _flash_contact session flag in form.php partial to show
contact email line on share link validation errors (separate from
flash_error/warning to bypass htmlspecialchars double-escaping).
2026-05-19 00:08:05 +02:00

2.4 KiB

TODO

  • Fix language-search-fragment: use searchLanguages() like tag fragment, remove broken predefined exclusion logic
  • Both fragments now follow identical patterns
  • Fix "Créer" button not appearing on language search: both language and tag inputs used name="q" in the same form, causing HTMX to submit the wrong (empty) value — renamed to unique names (language_search_q / tag_search_q)
  • Exclude Français, Anglais, Néerlandais from language-search suggestions (handled by the checkbox list)
  • Refactor file upload naming convention
    • Create shared ThesisFileHandler trait (src/Controllers/ThesisFileHandler.php)
    • New pattern: theses/{YYYY}/{YYYY}{AUTHORS}{TITLE_SLUG}/
    • COUVERTURE: single cover image in thesis folder (covers/ directory deprecated)
    • NOTE_INTENTION: single PDF in thesis folder
    • TFE_{XX}: main files, contiguous numbering 01+, hierarchy PDF > video > audio > subtitles > images > other
    • Subtitles (VTT) placed immediately after their associated video in TFE sequence
    • ANNEXE_{XX}: annex files, separate numbering 01+
    • Two-digit zero-padded numbering (sprintf('%02d', ...))
    • Update ThesisCreateController.php: use trait, new file handling
    • Update ThesisEditController.php: use trait, new file handling
    • Remove duplicate methods (generateAuthorSlug, sanitizeFilename, etc.) from both controllers
    • Update Database.php: deprecate handleCoverUpload, remove banner_path from queries
    • Update SystemController.php: remove banners/ stats
    • Update schema.sql: remove banner_path column and view field
    • Create migration 027_drop_banner_path.sql
    • Update PureLogicTest.php: adapt detectFileType call signature
    • All pure logic tests pass
  • Fix license validation: only require license for non-admin when access_type_id=1 (Libre), not for Interne (2) or Interdit (3) — fixes share link submissions failing with "Veuillez sélectionner une licence"
  • Add xamxam@erg.be mailto link at top of student (partage) form
  • On validation error, append "envoyez un e-mail à xamxam@erg.be" to flash error message
  • Preserve uploaded file names across validation redirects: store in session, display as warning on re-render so the student knows which files to re-select
  • Obfuscate all email addresses and mailto: links as HTML decimal entities site-wide (EmailObfuscator class, applied in templates + Parsedown post-processing)