| 234 |
=====##http_security_headers(): void##===== |
| 235 |
|
| 236 |
Sets security-related HTTP headers. |
| 237 |
|
| 238 |
**Headers Set:** |
| 239 |
|
| 240 |
#| |
| 241 |
*| Header | Purpose | Config Key |* |
| 242 |
|| Content-Security-Policy | XSS/injection protection | ##csp## || |
| 243 |
|| Permissions-Policy | Control browser features | ##permissions_policy## || |
| 244 |
|| Referrer-Policy | Control referrer information | ##referrer_policy## || |
| 245 |
|| Strict-Transport-Security | Force HTTPS | Auto (TLS only) || |
| 246 |
|| X-Frame-Options | Clickjacking protection | Hardcoded: ##SAMEORIGIN## || |
| 247 |
|| X-Content-Type-Options | MIME sniffing prevention | Hardcoded: ##nosniff## || |
| 248 |
|# |
| 249 |
|
| 250 |
**CSP Configuration Options:** |
| 251 |
- ##0## - Disabled |
| 252 |
- ##1## - Default policy (from ##csp.conf##) |
| 253 |
- ##2## - Custom policy (from ##csp_custom.conf##) |
| 254 |
|
| 255 |
**Example:** |
| 256 |
%%php |
| 257 |
$http->http_security_headers(); |
| 258 |
%% |
| 259 |
|
| 260 |
---- |
| 525 |
===Configuration Dependencies=== |
| 526 |
|
| 527 |
The class relies on these database configuration settings: |
| 528 |
|
| 529 |
#| |
| 530 |
*| Setting | Type | Purpose |* |
| 531 |
|| ##base_url## | string | Wiki's base URL || |
| 532 |
|| ##tls## | bool | Enable HTTPS enforcement || |
| 533 |
|| ##cache## | bool | Enable page caching || |
| 534 |
|| ##cache_ttl## | int | Cache lifetime in seconds || |
| 535 |
|| ##session_store## | int | 1=File, 0=Database || |
| 536 |
|| ##system_seed_hash## | string | Session encryption seed || |
| 537 |
|| ##cookie_prefix## | string | Session cookie prefix || |
| 538 |
|| ##cookie_path## | string | Cookie path || |
| 539 |
|| ##allow_persistent_cookie## | bool | Allow persistent login || |
| 540 |
|| ##session_length## | int | Session lifetime in seconds || |
| 541 |
|| ##reverse_proxy_addresses## | string | Comma/space-separated proxy IPs || |
| 542 |
|| ##reverse_proxy_header## | string | Custom X-Forwarded header || |
| 543 |
|| ##language## | string | Default language code || |
| 544 |
|| ##multilanguage## | bool | Enable language negotiation || |
| 545 |
|| ##allowed_languages## | string | Comma/space-separated allowed langs || |
| 546 |
|| ##enable_security_headers## | bool | Send security headers || |
| 547 |
|| ##csp## | int | CSP setting (0/1/2) || |
| 548 |
|| ##permissions_policy## | int | Permissions-Policy setting (0/1/2) || |
| 549 |
|| ##referrer_policy## | int | Referrer-Policy setting (0-8) || |
| 550 |
|# |
| 551 |
|
| 552 |
---- |