mirror of
https://github.com/openvk/chandler.git
synced 2025-01-22 15:24:15 +03:00
Fix Anti-CSRF check condition
Pervious version is made chandler unusable if it runs on port different from 443.
This commit is contained in:
parent
3093be04a6
commit
3cc25bec51
1 changed files with 1 additions and 1 deletions
|
@ -85,7 +85,7 @@ class Router
|
||||||
[$hash, $nonce] = $data;
|
[$hash, $nonce] = $data;
|
||||||
|
|
||||||
if(sodium_memcmp($this->makeCSRFToken($route, hex2bin($nonce)), "$hash#$nonce") === 0)
|
if(sodium_memcmp($this->makeCSRFToken($route, hex2bin($nonce)), "$hash#$nonce") === 0)
|
||||||
$GLOBALS["csrfCheck"] = parse_url($_SERVER["HTTP_REFERER"], PHP_URL_HOST) === $_SERVER["HTTP_HOST"];
|
$GLOBALS["csrfCheck"] = parse_url($_SERVER["HTTP_REFERER"], PHP_URL_HOST) === parse_url($_SERVER["HTTP_HOST"], PHP_URL_HOST);
|
||||||
} catch(\SodiumException $ex) {}
|
} catch(\SodiumException $ex) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue