|
|
@ -242,7 +242,7 @@ function nospam_encrypt_decrypt_post($form=null) { |
|
|
|
foreach ($_POST as $k => $v) { |
|
|
|
$kd = nospam_name_decode($k, $jeton); |
|
|
|
if ($kd !== $k and _request($kd) !== $v) { |
|
|
|
set_request($kd, $v); |
|
|
|
nospam_encrypt_posted($form, $kd, $v); |
|
|
|
$re_verifier = true; |
|
|
|
} |
|
|
|
} |
|
|
@ -252,4 +252,29 @@ function nospam_encrypt_decrypt_post($form=null) { |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Lister les valeurs que l'on a bien recue cryptees pour un formulaire donne |
|
|
|
* Permet aux formulaires de verifier qu'une valeur critique n'a pas ete postee en clair par un spammeur |
|
|
|
* * si $key et $value sont fournies, peuple le tableau et fait un set_request en meme temps |
|
|
|
* @param string $form |
|
|
|
* @param string $key |
|
|
|
* @param mixed $value |
|
|
|
* @return array |
|
|
|
* liste des valeurs postees pour ce formulaire |
|
|
|
*/ |
|
|
|
function nospam_encrypt_posted($form, $key = null, $value = null) { |
|
|
|
static $posted = []; |
|
|
|
|
|
|
|
if (!is_null($key)) { |
|
|
|
if (!isset($posted[$form])) { |
|
|
|
$posted[$form] = []; |
|
|
|
} |
|
|
|
|
|
|
|
$posted[$form][$key] = $value; |
|
|
|
set_request($key, $value); |
|
|
|
} |
|
|
|
|
|
|
|
return $posted[$form] ?? []; |
|
|
|
} |