mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
dbmanager blankspaces transparent to user
This commit is contained in:
parent
2cfc9db26b
commit
2c37ef4acb
@ -22,6 +22,17 @@ function dbmanager_query($sql, &$error, $dbconnection)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = html_entity_decode($sql, ENT_QUOTES);
|
$sql = html_entity_decode($sql, ENT_QUOTES);
|
||||||
|
|
||||||
|
// Extract the text in quotes to add html entities before query db.
|
||||||
|
$patttern = '/(?:"|\')+([^"\']*)(?:"|\')+/m';
|
||||||
|
$sql = preg_replace_callback(
|
||||||
|
$patttern,
|
||||||
|
function ($matches) {
|
||||||
|
return '"'.io_safe_input($matches[1]).'"';
|
||||||
|
},
|
||||||
|
$sql
|
||||||
|
);
|
||||||
|
|
||||||
if ($config['mysqli']) {
|
if ($config['mysqli']) {
|
||||||
$result = mysqli_query($dbconnection, $sql);
|
$result = mysqli_query($dbconnection, $sql);
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user