fix: dbUpdate calls now check if it is 0 or above (#4996)

This commit is contained in:
Neil Lathwood
2016-11-16 04:06:46 +00:00
committed by Tony Murray
parent 25d67c6d79
commit 7061acf508
4 changed files with 5 additions and 5 deletions

View File

@@ -43,7 +43,7 @@ if (!empty($name)) {
if (substr($_REQUEST['rule_id'], -1, 1) != ",") {
$_REQUEST['rule_id'] .= ",";
}
if (dbUpdate(array('rule_id' => mres($_REQUEST['rule_id']), 'name' => $name), "alert_templates", "id = ?", array($_REQUEST['template_id']))) {
if (dbUpdate(array('rule_id' => mres($_REQUEST['rule_id']), 'name' => $name), "alert_templates", "id = ?", array($_REQUEST['template_id'])) >= 0) {
$ok = "Updated template and rule id mapping";
} else {
$error ="Failed to update the template and rule id mapping";
@@ -51,7 +51,7 @@ if (!empty($name)) {
} elseif ($_REQUEST['template'] && is_numeric($_REQUEST['template_id'])) {
//Update template-text
if ($ret = dbUpdate(array('template' => $_REQUEST['template'], 'name' => $name, 'title' => $_REQUEST['title'], 'title_rec' => $_REQUEST['title_rec']), "alert_templates", "id = ?", array($_REQUEST['template_id']))) {
if (dbUpdate(array('template' => $_REQUEST['template'], 'name' => $name, 'title' => $_REQUEST['title'], 'title_rec' => $_REQUEST['title_rec']), "alert_templates", "id = ?", array($_REQUEST['template_id'])) >= 0) {
$ok = "Updated template";
} else {
$error = "Failed to update the template";