Skip to content

Commit 7c19f2d

Browse files
committed
- Databases: Make sure backup_interval is a string, not an integer.
1 parent ceab233 commit 7c19f2d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

interface/web/sites/database_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ function onAfterInsert() {
421421

422422
//* The Database user shall be owned by the same group then the website
423423
$sys_groupid = $app->functions->intval($web['sys_groupid']);
424-
$backup_interval = $web['backup_interval'];
424+
$backup_interval = $app->db->quote($web['backup_interval']);
425425
$backup_copies = $app->functions->intval($web['backup_copies']);
426426

427427
$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 @@ function onAfterUpdate() {
437437

438438
//* The Database user shall be owned by the same group then the website
439439
$sys_groupid = $app->functions->intval($web['sys_groupid']);
440-
$backup_interval = $web['backup_interval'];
440+
$backup_interval = $app->db->quote($web['backup_interval']);
441441
$backup_copies = $app->functions->intval($web['backup_copies']);
442442

443443
$sql = "UPDATE web_database SET sys_groupid = '$sys_groupid', backup_interval = '$backup_interval', backup_copies = '$backup_copies' WHERE database_id = ".$this->id;

interface/web/sites/web_domain_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ function onAfterUpdate() {
10121012
//* Change database backup options when web backup options have been changed
10131013
if(isset($this->dataRecord['backup_interval']) && ($this->dataRecord['backup_interval'] != $this->oldDataRecord['backup_interval'] || $this->dataRecord['backup_copies'] != $this->oldDataRecord['backup_copies'])) {
10141014
//* Update all databases
1015-
$backup_interval = $app->functions->intval($this->dataRecord['backup_interval']);
1015+
$backup_interval = $app->db->quote($this->dataRecord['backup_interval']);
10161016
$backup_copies = $app->functions->intval($this->dataRecord['backup_copies']);
10171017
$records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE parent_domain_id = ".$this->id);
10181018
foreach($records as $rec) {

0 commit comments

Comments
 (0)