E_ERROR, 'message' => "Uncaught Error: Call to undefined function foo() in {$root}/staff/x.php:12", 'file' => $root . '/staff/x.php', 'line' => 12]; // Empfänger $pdo->prepare("INSERT INTO staff (name, email, password_hash, role, is_active, created_at) VALUES ('Chef','chef@firma.example','x','admin',1,?)")->execute([db_now()]); set_setting('admin_email', ''); $check(in_array('chef@firma.example', error_alert_recipients($pdo), true), 'ohne eigene Adresse gehen die Mails an die Administratoren'); set_setting('admin_email', 'it@firma.example'); $check(error_alert_recipients($pdo) === ['it@firma.example'], 'die Admin-Adresse der Seite hat Vorrang'); set_setting('error_alert_email', 'a@firma.example, b@firma.example; kaputt'); $check(error_alert_recipients($pdo) === ['a@firma.example', 'b@firma.example'], 'eigene Empfänger (mehrere, ungültige werden übersprungen)'); // Inhalt $_SERVER['REQUEST_URI'] = '/staff/tickets.php?token=GEHEIM&x=1'; [$subject, $html] = error_alert_compose($err); $check(str_contains($html, 'staff/x.php') && str_contains($html, 'Zeile 12') && str_contains($html, '/staff/tickets.php'), 'Mail nennt Datei, Zeile und Seite'); $check(!str_contains($html, 'GEHEIM') && !str_contains($html, $root), 'Mail enthält weder Adress-Parameter noch den Serverpfad'); [, $evil] = error_alert_compose(['message' => '', 'file' => 'x', 'line' => 1]); $check(!str_contains($evil, '