summaryrefslogtreecommitdiff
path: root/classes/Handler.php
blob: 5b54570d8dab1b3a68794fc399ce4585c22982d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
class Handler implements IHandler {
	protected PDO $pdo;

	/** @var array<int|string, mixed> */
	protected array $args;

	/**
	 * @param array<int|string, mixed> $args
	 */
	function __construct(array $args) {
		$this->pdo = Db::pdo();
		$this->args = $args;
	}

	function csrf_ignore(string $method): bool {
		return false;
	}

	function before(string $method): bool {
		return true;
	}

	function after(): bool {
		return true;
	}

	/**
	 * @param mixed $p
	 */
	protected static function _param_to_bool($p): bool {
		$p = clean($p);
		return $p && ($p !== "f" && $p !== "false");
	}
}