Commit 59f1a38720429712fdef7f56ab406c6bb0322f71
1 parent
70d14fc7
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
ferramentas/parametrossql/exec.php
@@ -30,13 +30,16 @@ Aplica a substituicao de chaves pelos valores enviados | @@ -30,13 +30,16 @@ Aplica a substituicao de chaves pelos valores enviados | ||
30 | else{ | 30 | else{ |
31 | $layer->setmetadata("FILTROORIGINAL",$filtro); | 31 | $layer->setmetadata("FILTROORIGINAL",$filtro); |
32 | } | 32 | } |
33 | + $chaves = str_ireplace(array("and", "or", "select","from","where","update","delete","insert","--"),"",$chaves); | ||
33 | $chaves = explode(",",$chaves); | 34 | $chaves = explode(",",$chaves); |
34 | - $valores = explode(",",$valores); | 35 | + $valores = str_ireplace(array("and", "or", "select","from","where","update","delete","insert","--"),"",$valores); |
36 | + $valores = explode(",",strip_tags($valores)); | ||
35 | $n = count($chaves); | 37 | $n = count($chaves); |
36 | for($i = 0; $i < $n; $i++){ | 38 | for($i = 0; $i < $n; $i++){ |
37 | - $data = str_replace($chaves[$i],$valores[$i],$data); | 39 | + $v = $valores[$i]; |
40 | + $data = str_replace($chaves[$i],$v,$data); | ||
38 | if($filtro != ""){ | 41 | if($filtro != ""){ |
39 | - $filtro = str_replace($chaves[$i],$valores[$i],$filtro); | 42 | + $filtro = str_replace($chaves[$i],$v,$filtro); |
40 | } | 43 | } |
41 | } | 44 | } |
42 | if($filtro != ""){ | 45 | if($filtro != ""){ |