1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 07:06:45 +02:00

Defer syntax highlighting

This commit is contained in:
Jakub Vrana
2025-04-07 14:12:44 +02:00
parent 7d3d46e509
commit b0e5c1d6e4
4 changed files with 57 additions and 57 deletions

View File

@@ -7,8 +7,8 @@ function script(string $source, string $trailing = "\n"): string {
}
/** Return <script src> element */
function script_src(string $url): string {
return "<script src='" . h($url) . "'" . nonce() . "></script>\n";
function script_src(string $url, bool $defer = false): string {
return "<script src='" . h($url) . "'" . nonce() . ($defer ? " defer" : "") . "></script>\n";
}
/** Get a nonce="" attribute with CSP nonce */