Current Directory:
/home/webapp68.cm.in.th/u68319090016/app/lib
Upload
Create File
File Name
Size
Actions
functions.php
446 bytes
Edit
|
Delete
|
Rename
|
Download
<?php function e(string $str): string { return htmlspecialchars($str, ENT_QUOTES, 'UTF-8'); } function current_user(): ?array { return $_SESSION['user'] ?? null; } function csrf_token(): string { if (empty($_SESSION['csrf'])) { $_SESSION['csrf'] = bin2hex(random_bytes(32)); } return $_SESSION['csrf']; } function verify_csrf($token): bool { return isset($_SESSION['csrf']) && hash_equals($_SESSION['csrf'], $token); }
Save Changes