debut verification var session

pull/22/head^2
brongniart 5 months ago
parent 1301b8ecfc
commit 4a4f204cb3

@ -13,6 +13,7 @@ use Twig\Error\LoaderError;
use Twig\Error\RuntimeError; use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError; use Twig\Error\SyntaxError;
use Verification\VerificationChar;
Class VisitorControler { Class VisitorControler {
@ -69,7 +70,7 @@ Class VisitorControler {
global $vues; global $vues;
$type = ($_POST['type'] ?? ""); $type = ($_POST['type'] ?? "");
$search = ( $_POST['search'] ?? NULL); $search = ( VerificationChar::verifChar( $_POST['search'] ) ?? NULL);
$filtre = ($arg['filtre'] ?? []); $filtre = ($arg['filtre'] ?? []);
@ -126,7 +127,7 @@ Class VisitorControler {
{ {
$_SESSION['user'] = $pseudo; $_SESSION['user'] = $pseudo;
$_SESSION['role'] = 'user'; $_SESSION['role'] = 'user';
header("Location: ". $racine); ///~kekentin/WF/WF-Website/ header("Location: ". $racine);
exit(); exit();
}else }else
{ {

@ -1,18 +0,0 @@
<?php
namespace Verification;
class Verification
{
public static function verifChar(string $text) : string{
$charInterdi=['&','|','/','\\','%','$'];
$textVerif="";
foreach( $text as $char){
if( !in_array($char,$charInterdi) ){
$textVerif=$textVerif+$char;
}
}
return $textVerif;
}
}
?>

@ -0,0 +1,19 @@
<?php
namespace Verification{
class VerificationChar
{
public static function verifChar(string $text) : string{
$charInterdi=['&','|','/','\\','%','$'];
$textVerif="";
foreach( $text as $char){
if( !in_array($char,$charInterdi) ){
$textVerif=$textVerif+$char;
}
}
return $textVerif;
}
}
}
?>
Loading…
Cancel
Save