Merge branch 'ent-5154-DB-interface-apto-espacios-en-blanco-queries' into 'develop'

dbmanager blankspaces transparent to user

See merge request artica/pandorafms!2986
This commit is contained in:
Alejandro Fraguas 2019-12-27 12:25:30 +01:00
commit a8e8a38fc7
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) {