dbmanager blankspaces transparent to user

This commit is contained in:
Luis Calvo 2019-12-20 14:18:48 +01:00
parent 2cfc9db26b
commit 2c37ef4acb
1 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,17 @@ function dbmanager_query($sql, &$error, $dbconnection)
}
$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']) {
$result = mysqli_query($dbconnection, $sql);
if ($result === false) {