Fix sql error
This commit is contained in:
parent
0d5c613008
commit
d93fbcd00b
@ -653,7 +653,7 @@ class ProductFournisseur extends Product
|
|||||||
$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
|
$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
|
||||||
$sql .= " AND pfp.fk_soc = s.rowid AND pfp.fk_product = p.rowid";
|
$sql .= " AND pfp.fk_soc = s.rowid AND pfp.fk_product = p.rowid";
|
||||||
$sql .= " AND s.status=1"; // only enabled company selected
|
$sql .= " AND s.status=1"; // only enabled company selected
|
||||||
$sql .= " AND pfp.fk_product = ".$prodid;
|
$sql .= " AND pfp.fk_product = ".((int) $prodid);
|
||||||
if (empty($sortfield)) {
|
if (empty($sortfield)) {
|
||||||
$sql .= " ORDER BY s.nom, pfp.quantity, pfp.price";
|
$sql .= " ORDER BY s.nom, pfp.quantity, pfp.price";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -150,7 +150,7 @@ function testSqlAndScriptInject($val, $type)
|
|||||||
$inj += preg_match('/"/i', $val); // We refused " in GET parameters value.
|
$inj += preg_match('/"/i', $val); // We refused " in GET parameters value.
|
||||||
}
|
}
|
||||||
if ($type == 2) {
|
if ($type == 2) {
|
||||||
$inj += preg_match('/[:;"\'<>\?\(\)]/', $val); // PHP_SELF is a file system (or url path without parameters). It can contains spaces.
|
$inj += preg_match('/[:;"\'<>\?\(\){}\$%]/', $val); // PHP_SELF is a file system (or url path without parameters). It can contains spaces.
|
||||||
}
|
}
|
||||||
|
|
||||||
return $inj;
|
return $inj;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user