Skip to content
Extraits de code Groupes Projets
Valider 65d5d1d6 rédigé par renato's avatar renato
Parcourir les fichiers

better regex to avoid js injections. It did not avoid a js injection when...

better regex to avoid js injections. It did not avoid a js injection when passing 3,5,7,... '\' inside var_recherche
parent 11cf6248
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -41,7 +41,7 @@ function surligner_mots($page) { ...@@ -41,7 +41,7 @@ function surligner_mots($page) {
$ref = $_SERVER['HTTP_REFERER']; $ref = $_SERVER['HTTP_REFERER'];
//avoid a js injection //avoid a js injection
$surcharge_surligne = preg_replace(",(?<!\\\\)',","\'",$_GET["var_recherche"]); $surcharge_surligne = preg_replace(",(?:\\\\{2})*(?:\\\\)',","\'",$_GET["var_recherche"]);
foreach($surlignejs_engines as $engine) foreach($surlignejs_engines as $engine)
if($surcharge_surligne || (preg_match($engine[0],$ref) && preg_match($engine[1],$ref))) { if($surcharge_surligne || (preg_match($engine[0],$ref) && preg_match($engine[1],$ref))) {
//good referrer found or var_recherche is not null //good referrer found or var_recherche is not null
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter