Issues (1519)

system/modules/Server/Server.php (1 issue)

1
<?php
2
3
namespace Inji;
4
/**
5
 * Server module
6
 *
7
 * @author Alexey Krupskiy <[email protected]>
8
 * @link http://inji.ru/
9
 * @copyright 2015 Alexey Krupskiy
10
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
11
 */
12
class Server extends Module {
13
    public $name = 'Server';
14
15
    function checkCsrf($key, $token) {
16
        return !empty($_SESSION['csrf'][$key]) && $_SESSION['csrf'][$key] == $token;
17
    }
18
19
    function checkCsrfForm($formData) {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
20
        if (empty($formData['csrfKey']) || empty($formData['csrfToken'])) {
21
            return false;
22
        }
23
        return $this->checkCsrf($formData['csrfKey'], $formData['csrfToken']);
24
    }
25
}
26