mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-22 17:46:36 +00:00
Add a function to test user params
This commit is contained in:
parent
ae1a4cdb5a
commit
82ea497112
1 changed files with 16 additions and 0 deletions
|
|
@ -153,6 +153,22 @@ function validateEmail($email)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau
|
||||
* @param string $name La clé à tester
|
||||
* @param array $tableau Le tableau où rechercher la clé ($_POST par défaut)
|
||||
* @return bool Vrai si la clé existe et renvoie une valeur non vide
|
||||
*/
|
||||
function issetAndNoEmpty($name, $tableau = null)
|
||||
{
|
||||
if ($tableau === null) {
|
||||
$tableau = $_POST;
|
||||
}
|
||||
|
||||
return (isset($tableau[$name]) === true && empty($tableau[$name]) === false);
|
||||
}
|
||||
|
||||
|
||||
$connect=connexion_base();
|
||||
|
||||
define('COMMENT_EMPTY', 0x0000000001);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue