Files
Plenario/templates/element/flash/default.php
gnilebeinandClaude Opus 5.5 2a53675ce5
CI / Deploy / test (push) Successful in 1m1s
CI / Deploy / deploy (push) Skipped
Send a Content-Security-Policy and security headers on every response
- New SecurityHeadersMiddleware (outermost): CSP with a per-request script
  nonce, framing (SAMEORIGIN, embeds via frame-ancestors), nosniff,
  Referrer- and Permissions-Policy. JSON, files and error pages are covered
  now, not only rendered HTML; headers set by controllers still win.
- The inline theme script carries the nonce; flash messages are dismissed
  via data-dismiss instead of inline onclick handlers, and the flash
  elements share one template.
- reCAPTCHA sources are only allowed when it is enabled.
- The embed CSRF exception and framing use the same isEmbed() check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 22:43:36 +01:00

19 lines
537 B
PHP

<?php
/**
* Flash message; the other flash elements (success, error, …) only add their class.
* Click to dismiss is handled by [data-dismiss] in webroot/js/plenario.js (no inline handler, CSP).
*
* @var \App\View\AppView $this
* @var array $params
* @var string $message
*/
$class = 'message';
if (!empty($params['class'])) {
$class .= ' ' . $params['class'];
}
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<div class="<?= h($class) ?>" data-dismiss><?= $message ?></div>