Forum » » Questions » » chat
Posté : 6 sept. 2023 à 10:09
function check_id(string $chaine): array
{
global $user;
// Vérifie si la chaîne est du style NOMBRE-NOMBRE.
if (count(str_split($chaine, "-")) == 2 && is_numeric(explode("-", $chaine)[0]) && is_numeric(explode("-", $chaine)[1])) {
// La chaîne est du style NOMBRE-NOMBRE.
$userid = explode("-", $chaine);
$cookie=cookiedecode($user);
if ($cookie[1] !== $userid[0] || $cookie[1] !== $userid[0]){
die();
}
}
// Vérifie si la chaîne est un nombre compris entre -127 et 126.
if (is_numeric($chaine) && abs($chaine) <= 126) {
// La chaîne est un nombre compris entre -127 et 126.
if (!autorisation($chaine)) die();
}
die();
}
check_id($id);
Cet article provient de NPDS
https://www.npds.org/viewtopic.php?topic=26844&forum=9