Difference between revisions for Users / Eo Ny / dev




← Previous edit
Next edit →

Version1 Version2
12 12
13 === Class Properties === 13 === Class Properties ===
14 14
15 ==== Public Properties ==== 15 ====Public Properties====
16 16
17 17 #|
18 18 *| Property | Type | Description |*
19 ==== Private Properties ==== 19 || ##$tls_session## | bool | Indicates if the current session uses HTTPS/TLS encryption ||
20 20 || ##$request_uri## | string | Normalized REQUEST_URI (e.g., 'PageOfNoReturn/show?a=1') ||
21 21 || ##$ip## | string | Client's real IP address (accounts for proxies) ||
    22 || ##$sess## | Session | Reference to the Session object ||
    23 || ##$method## | string | Current HTTP method/request type ||
    24 |#
    25
    26 ====Private Properties====
    27
    28 #|
    29 *| Property | Type | Description |*
    30 || ##$db## | object | Database connection reference ||
    31 || ##$tls_mark## | string | Cookie name for TLS session marking ||
    32 || ##$page## | string | Current page name being processed ||
    33 || ##$hash## | string | SHA1 hash of the page name ||
    34 || ##$query## | string | Encoded query string ||
    35 || ##$lang## | string | Current language code ||
    36 || ##$file## | string | Cache file path ||
    37 || ##$caching## | int | Flag indicating if page should be cached (0 or 1) ||
    38 |#
    39
    40 ----
22 === Constructor === 41 === Constructor ===
23 42
24 %%php 43 %%php
212 231
213 ==== Security Headers ==== 232 ==== Security Headers ====
214 233
215 ===== ##http_security_headers(): void## ===== 234 =====##http_security_headers(): void##=====
216 235
217 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 ----
218 ==== HTTP Methods ==== 261 ==== HTTP Methods ====
219 262
220 ===== ##redirect($url, $permanent = false): void## ===== 263 ===== ##redirect($url, $permanent = false): void## =====
479 522
480 ---- 523 ----
481 524
482 === Configuration Dependencies === 525 ===Configuration Dependencies===
483 526
484 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 ----
485 553
486 === Constants Used === 554 === Constants Used ===
487 555