commit
6b1c67a410
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Validation {
|
||||||
|
|
||||||
|
static function val_form_texte(&$texte, &$TMessage) {
|
||||||
|
if (!isset($texte)||$texte=="") {
|
||||||
|
$TMessage[] ="Empty fields";
|
||||||
|
$texte="";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($texte != filter_var($texte, FILTER_SANITIZE_STRING))
|
||||||
|
{
|
||||||
|
$TMessage[]="Attempt to inject code (security attack)";
|
||||||
|
$texte="";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static function val_form_mdp(&$mdp, &$TMessage) {
|
||||||
|
if (!isset($mdp)||$mdp=="") {
|
||||||
|
$TMessage[] ="Password not specified";
|
||||||
|
$mdp="";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($mdp != filter_var($mdp, FILTER_SANITIZE_SPECIAL_CHARS))
|
||||||
|
{
|
||||||
|
$TMessage[] ="Password must not contain special characters";
|
||||||
|
$mdp="";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once("config/config.php");
|
require_once("config/config.php");
|
||||||
require_once("controller/FrontCtrl.php");
|
require_once("controller/FrontCtrl.php");
|
||||||
|
require('config/Validation.php');
|
||||||
|
require("view/erreur.php");
|
||||||
|
|
||||||
$fc = new FrontCtrl($con);
|
$fc = new FrontCtrl($con);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
Reference in new issue