Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Views/auth/forgot-password.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<style>
body { font-family: system-ui, -apple-system, sans-serif; }
</style>
<?php require __DIR__ . '/partials/custom-css.php'; ?>
</head>
<body class="bg-gray-50 dark:bg-gray-900">

Expand Down
1 change: 1 addition & 0 deletions app/Views/auth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<style>
body { font-family: system-ui, -apple-system, sans-serif; }
</style>
<?php require __DIR__ . '/partials/custom-css.php'; ?>
</head>
<body class="bg-gray-50">

Expand Down
28 changes: 28 additions & 0 deletions app/Views/auth/partials/custom-css.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* Shared custom-CSS <style> block (issue #262 / PR #265).
*
* Emits the admin-configured `advanced.custom_header_css` so it applies to the
* unauthenticated auth pages (login/register/forgot/reset) and the frontend
* layout, not just the app chrome.
*
* SECURITY: MUST use ContentSanitizer::sanitizeCustomCss() — the same
* render-time sanitizer used by frontend/layout.php. It strips <style>/<script>
* openings/closings and HTML comment markers, preventing a stored
* `</style><script>…` payload from breaking out of the raw-text <style> context
* and executing JS (stored XSS). normalizeExternalAssets() alone (fonts-only)
* does NOT stop that breakout — do not swap it in here.
*/

use App\Support\ConfigStore;
use App\Support\ContentSanitizer;

$customCss = ConfigStore::get('advanced.custom_header_css', '');
$customCss = is_string($customCss) ? ContentSanitizer::sanitizeCustomCss($customCss) : '';
if ($customCss !== ''):
?>
<style>
<?= $customCss ?>
</style>
<?php endif; ?>
1 change: 1 addition & 0 deletions app/Views/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<style>
body { font-family: system-ui, -apple-system, sans-serif; }
</style>
<?php require __DIR__ . '/partials/custom-css.php'; ?>
</head>
<body class="bg-gray-50">

Expand Down
1 change: 1 addition & 0 deletions app/Views/auth/register_success.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<style>
body { font-family: system-ui, -apple-system, sans-serif; }
</style>
<?php require __DIR__ . '/partials/custom-css.php'; ?>
</head>
<body class="bg-gray-50 dark:bg-gray-900">

Expand Down
1 change: 1 addition & 0 deletions app/Views/auth/reset-password.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<style>
body { font-family: system-ui, -apple-system, sans-serif; }
</style>
<?php require __DIR__ . '/partials/custom-css.php'; ?>
</head>
<body class="bg-gray-50 dark:bg-gray-900">

Expand Down
13 changes: 4 additions & 9 deletions app/Views/frontend/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -1263,15 +1263,10 @@
</style>

<?php
// Load custom CSS from settings
$customCss = ConfigStore::get('advanced.custom_header_css', '');
$customCss = is_string($customCss) ? ContentSanitizer::sanitizeCustomCss($customCss) : $customCss;
if (!empty($customCss)):
?>
<style>
<?= $customCss ?>
</style>
<?php endif; ?>
// Load custom CSS from settings (shared partial — also used by the auth
// pages). Uses ContentSanitizer::sanitizeCustomCss() internally.
require __DIR__ . '/../auth/partials/custom-css.php';
?>

<?php
// Load custom JavaScript from settings (granular by cookie category)
Expand Down
11 changes: 6 additions & 5 deletions app/Views/libri/partials/book_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,13 @@
// /api/search/autori autocomplete as authors, so an illustrator/
// translator/curator/colorist is a real author entity (findable by
// pseudonym, appears on the author page), not free text.
$contributorHelp = __('Cerca un autore esistente o scrivine uno nuovo');
// Role-specific help text (issue #237): each field names its own role
// so the hint reads naturally instead of a generic "author" for all.
$contributorFields = [
'illustratori' => ['label' => __('Illustratore'), 'help' => $contributorHelp],
'traduttori' => ['label' => __('Traduttore'), 'help' => $contributorHelp],
'curatori' => ['label' => __('Curatore'), 'help' => $contributorHelp],
'coloristi' => ['label' => __('Colorista'), 'help' => __('Cerca un autore esistente o scrivine uno nuovo (utile per i fumetti)')],
'illustratori' => ['label' => __('Illustratore'), 'help' => __('Cerca un illustratore esistente o aggiungine uno nuovo digitando il nome')],
'traduttori' => ['label' => __('Traduttore'), 'help' => __('Cerca un traduttore esistente o aggiungine uno nuovo digitando il nome')],
'curatori' => ['label' => __('Curatore'), 'help' => __('Cerca un curatore esistente o aggiungine uno nuovo digitando il nome')],
'coloristi' => ['label' => __('Colorista'), 'help' => __('Cerca un colorista esistente o aggiungine uno nuovo digitando il nome (utile per i fumetti)')],
];
?>
<input type="hidden" id="contributors_entity_picker" name="contributors_entity_picker" value="0" />
Expand Down
60 changes: 30 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions locale/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -6551,6 +6551,10 @@
"Nessun risultato, premi Invio per aggiungerne uno nuovo": "Keine Ergebnisse, Enter drücken, um einen neuen hinzuzufügen",
"Cerca un autore esistente o scrivine uno nuovo": "Vorhandenen Autor suchen oder neuen eingeben",
"Cerca un autore esistente o scrivine uno nuovo (utile per i fumetti)": "Vorhandenen Autor suchen oder neuen eingeben (nützlich für Comics)",
"Cerca un illustratore esistente o aggiungine uno nuovo digitando il nome": "Vorhandenen Illustrator suchen oder durch Eingabe des Namens einen neuen hinzufügen",
"Cerca un traduttore esistente o aggiungine uno nuovo digitando il nome": "Vorhandenen Übersetzer suchen oder durch Eingabe des Namens einen neuen hinzufügen",
"Cerca un curatore esistente o aggiungine uno nuovo digitando il nome": "Vorhandenen Kurator suchen oder durch Eingabe des Namens einen neuen hinzufügen",
"Cerca un colorista esistente o aggiungine uno nuovo digitando il nome (utile per i fumetti)": "Vorhandenen Koloristen suchen oder durch Eingabe des Namens einen neuen hinzufügen (nützlich für Comics)",
"Contributore \"%s\" è già selezionato": "Mitwirkender \"%s\" ist bereits ausgewählt",
"Contributore \"%s\" pronto per essere creato": "Mitwirkender \"%s\" bereit zur Erstellung",
"Numero": "Zahl",
Expand Down
4 changes: 4 additions & 0 deletions locale/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -6551,6 +6551,10 @@
"Nessun risultato, premi Invio per aggiungerne uno nuovo": "No results, press Enter to add a new one",
"Cerca un autore esistente o scrivine uno nuovo": "Search for an existing author or type a new one",
"Cerca un autore esistente o scrivine uno nuovo (utile per i fumetti)": "Search for an existing author or type a new one (useful for comics)",
"Cerca un illustratore esistente o aggiungine uno nuovo digitando il nome": "Search for an existing illustrator or add a new one by typing the name",
"Cerca un traduttore esistente o aggiungine uno nuovo digitando il nome": "Search for an existing translator or add a new one by typing the name",
"Cerca un curatore esistente o aggiungine uno nuovo digitando il nome": "Search for an existing curator or add a new one by typing the name",
"Cerca un colorista esistente o aggiungine uno nuovo digitando il nome (utile per i fumetti)": "Search for an existing colorist or add a new one by typing the name (useful for comics)",
"Contributore \"%s\" è già selezionato": "Contributor \"%s\" is already selected",
"Contributore \"%s\" pronto per essere creato": "Contributor \"%s\" ready to be created",
"Numero": "Number",
Expand Down
4 changes: 4 additions & 0 deletions locale/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -6551,6 +6551,10 @@
"Nessun risultato, premi Invio per aggiungerne uno nuovo": "Aucun résultat, appuyez sur Entrée pour en ajouter un nouveau",
"Cerca un autore esistente o scrivine uno nuovo": "Rechercher un auteur existant ou en saisir un nouveau",
"Cerca un autore esistente o scrivine uno nuovo (utile per i fumetti)": "Rechercher un auteur existant ou en saisir un nouveau (utile pour les BD)",
"Cerca un illustratore esistente o aggiungine uno nuovo digitando il nome": "Rechercher un illustrateur existant ou en ajouter un nouveau en saisissant le nom",
"Cerca un traduttore esistente o aggiungine uno nuovo digitando il nome": "Rechercher un traducteur existant ou en ajouter un nouveau en saisissant le nom",
"Cerca un curatore esistente o aggiungine uno nuovo digitando il nome": "Rechercher un directeur de publication existant ou en ajouter un nouveau en saisissant le nom",
"Cerca un colorista esistente o aggiungine uno nuovo digitando il nome (utile per i fumetti)": "Rechercher un coloriste existant ou en ajouter un nouveau en saisissant le nom (utile pour les BD)",
"Contributore \"%s\" è già selezionato": "Contributeur \"%s\" est déjà sélectionné",
"Contributore \"%s\" pronto per essere creato": "Contributeur \"%s\" prêt à être créé",
"Numero": "Nombre",
Expand Down
4 changes: 4 additions & 0 deletions locale/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -6551,6 +6551,10 @@
"Nessun risultato, premi Invio per aggiungerne uno nuovo": "Nessun risultato, premi Invio per aggiungerne uno nuovo",
"Cerca un autore esistente o scrivine uno nuovo": "Cerca un autore esistente o scrivine uno nuovo",
"Cerca un autore esistente o scrivine uno nuovo (utile per i fumetti)": "Cerca un autore esistente o scrivine uno nuovo (utile per i fumetti)",
"Cerca un illustratore esistente o aggiungine uno nuovo digitando il nome": "Cerca un illustratore esistente o aggiungine uno nuovo digitando il nome",
"Cerca un traduttore esistente o aggiungine uno nuovo digitando il nome": "Cerca un traduttore esistente o aggiungine uno nuovo digitando il nome",
"Cerca un curatore esistente o aggiungine uno nuovo digitando il nome": "Cerca un curatore esistente o aggiungine uno nuovo digitando il nome",
"Cerca un colorista esistente o aggiungine uno nuovo digitando il nome (utile per i fumetti)": "Cerca un colorista esistente o aggiungine uno nuovo digitando il nome (utile per i fumetti)",
"Contributore \"%s\" è già selezionato": "Contributore \"%s\" è già selezionato",
"Contributore \"%s\" pronto per essere creato": "Contributore \"%s\" pronto per essere creato",
"Numero": "Numero",
Expand Down
Loading
Loading