2011-12-12 20:32:29 +01:00
|
|
|
<?php
|
2012-12-23 20:05:51 +01:00
|
|
|
class Handler implements IHandler {
|
2022-08-12 16:13:26 +02:00
|
|
|
protected PDO $pdo;
|
2021-11-13 15:05:43 +01:00
|
|
|
|
|
|
|
/** @var array<int|string, mixed> */
|
2022-08-12 16:13:26 +02:00
|
|
|
protected array $args;
|
2011-12-12 20:32:29 +01:00
|
|
|
|
2021-11-13 15:05:43 +01:00
|
|
|
/**
|
|
|
|
* @param array<int|string, mixed> $args
|
|
|
|
*/
|
|
|
|
function __construct(array $args) {
|
2017-12-01 13:31:16 +01:00
|
|
|
$this->pdo = Db::pdo();
|
2011-12-12 20:32:29 +01:00
|
|
|
$this->args = $args;
|
|
|
|
}
|
|
|
|
|
2021-11-12 03:01:31 +01:00
|
|
|
function csrf_ignore(string $method): bool {
|
2020-09-15 17:16:33 +02:00
|
|
|
return false;
|
2011-12-26 09:02:52 +01:00
|
|
|
}
|
|
|
|
|
2021-11-13 15:05:43 +01:00
|
|
|
function before(string $method): bool {
|
2011-12-12 20:32:29 +01:00
|
|
|
return true;
|
|
|
|
}
|
2011-12-12 21:20:53 +01:00
|
|
|
|
2021-11-13 15:05:43 +01:00
|
|
|
function after(): bool {
|
2011-12-12 21:20:53 +01:00
|
|
|
return true;
|
|
|
|
}
|
2012-09-10 17:01:06 +02:00
|
|
|
|
2021-11-18 19:07:43 +01:00
|
|
|
/**
|
|
|
|
* @param mixed $p
|
|
|
|
*/
|
|
|
|
protected static function _param_to_bool($p): bool {
|
2021-11-18 19:18:49 +01:00
|
|
|
$p = clean($p);
|
2021-11-18 19:07:43 +01:00
|
|
|
return $p && ($p !== "f" && $p !== "false");
|
|
|
|
}
|
2020-09-15 17:16:33 +02:00
|
|
|
}
|