From 7c19f2dbb4608ef6b3f219d45490b25aa05e848c Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Fri, 28 Feb 2014 19:02:30 +0100
Subject: [PATCH] - Databases: Make sure backup_interval is a string, not an
 integer.

---
 interface/web/sites/database_edit.php   | 4 ++--
 interface/web/sites/web_domain_edit.php | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/interface/web/sites/database_edit.php b/interface/web/sites/database_edit.php
index 39499aa602..0f2f5f227d 100644
--- a/interface/web/sites/database_edit.php
+++ b/interface/web/sites/database_edit.php
@@ -421,7 +421,7 @@ class page_action extends tform_actions {
 
 			//* The Database user shall be owned by the same group then the website
 			$sys_groupid = $app->functions->intval($web['sys_groupid']);
-			$backup_interval = $web['backup_interval'];
+			$backup_interval = $app->db->quote($web['backup_interval']);
 			$backup_copies = $app->functions->intval($web['backup_copies']);
 
 			$sql = "UPDATE web_database SET sys_groupid = '$sys_groupid', backup_interval = '$backup_interval', backup_copies = '$backup_copies' WHERE database_id = ".$this->id;
@@ -437,7 +437,7 @@ class page_action extends tform_actions {
 
 			//* The Database user shall be owned by the same group then the website
 			$sys_groupid = $app->functions->intval($web['sys_groupid']);
-			$backup_interval = $web['backup_interval'];
+			$backup_interval = $app->db->quote($web['backup_interval']);
 			$backup_copies = $app->functions->intval($web['backup_copies']);
 
 			$sql = "UPDATE web_database SET sys_groupid = '$sys_groupid', backup_interval = '$backup_interval', backup_copies = '$backup_copies' WHERE database_id = ".$this->id;
diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php
index 630c9bcbf0..c2588c8f95 100644
--- a/interface/web/sites/web_domain_edit.php
+++ b/interface/web/sites/web_domain_edit.php
@@ -1012,7 +1012,7 @@ class page_action extends tform_actions {
 		//* Change database backup options when web backup options have been changed
 		if(isset($this->dataRecord['backup_interval']) && ($this->dataRecord['backup_interval'] != $this->oldDataRecord['backup_interval'] || $this->dataRecord['backup_copies'] != $this->oldDataRecord['backup_copies'])) {
 			//* Update all databases
-			$backup_interval = $app->functions->intval($this->dataRecord['backup_interval']);
+			$backup_interval = $app->db->quote($this->dataRecord['backup_interval']);
 			$backup_copies = $app->functions->intval($this->dataRecord['backup_copies']);
 			$records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ".$this->id);
 			foreach($records as $rec) {
-- 
GitLab