Redirect the other www spelling to SITE_ORIGIN, hold roles to the role help and fix the audit findings

SITE_ORIGIN alone decides whether the site is www or not: CanonicalHostSubscriber
sends the other spelling there with 301, cms:site:origin writes the setting, the
system screen shows it. The roles now match the role help (editor: drafts,
publisher: live content, admin: design, settings, users, system). The installer no
longer reopens on an unreachable database, the session cookie follows ADMIN_PATH,
percent-encoded credentials no longer break the container, consent only accepts
same-site decisions, JSON-LD is HTML-safe, own CSS stays in its block, plus the
editor, updater, download and public-output findings from the full review
(ADR 099, ADR 100).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
kantarciandClaude Fable 5.1 committed 2026-09-15 20:15:20 +02:00
1 parent 45040b2ca6
commit 7eb462ac7b
53 files changed
+1023 -122

No files matched your search

+15 -2
View File
@@ -9,8 +9,10 @@ use App\Content\PartialRepository;
use App\Content\SiteSettings;
use App\Domain\CmsUser;
use App\Domain\InvalidPage;
use App\EventSubscriber\InstallSubscriber;
use App\Infrastructure\ConnectionFactory;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception\TableNotFoundException;
use Doctrine\Migrations\Configuration\Connection\ExistingConnection;
use Doctrine\Migrations\Configuration\Migration\PhpFile;
use Doctrine\Migrations\DependencyFactory;
@@ -57,11 +59,22 @@ final class Installation
*/
public function isInstalled(): bool
{
// Die Marke schreibt die Website, sobald ein Konto existiert. Sie zaehlt auch dann, wenn
// die Datenbank gerade nicht antwortet: ein gedrehtes Passwort oder eine Wartung beim
// Hoster darf den Installer nicht wieder oeffnen - dort koennte sonst jeder eine eigene
// Datenbank eintragen und sich zum Administrator machen.
if (is_file($this->root.'/'.InstallSubscriber::MARKER)) {
return true;
}
try {
return (bool) $this->db->fetchOne('SELECT id FROM cms_user LIMIT 1');
} catch (\Throwable) {
// No database, no table, no installation - all three mean the same here.
} catch (TableNotFoundException) {
// Keine Tabelle: die Datenbank ist da, aber leer - das ist der Installer-Fall.
return false;
} catch (\Throwable) {
// Keine Verbindung. Vor dem Datenbankschritt ist das normal (es gibt noch keine
// eingetragene Datenbank); danach ist es eine Stoerung, keine fehlende Installation.
return $this->environmentWritten();
}
}