Skip to content

Commit 531afab

Browse files
committed
Fixes in BIND plugin when zones get deleted.
1 parent 7f3b24b commit 531afab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/plugins-available/bind_plugin.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function rr_delete($event_name,$data) {
236236
global $app, $conf;
237237

238238
//* Get the data of the soa and call soa_update
239-
$tmp = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ".$data['old']['zone']);
239+
$tmp = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ".intval($data['old']['zone']));
240240
$data["new"] = $tmp;
241241
$data["old"] = $tmp;
242242
$this->action = 'update';
@@ -254,7 +254,7 @@ function write_named_conf($data, $dns_config) {
254254
$zones = array();
255255

256256
//* Check if the current zone that triggered this function has at least one NS record
257-
$rec_num = $app->db->queryOneRecord("SELECT count(id) as ns FROM dns_rr WHERE type = 'NS' AND zone = ".$data['new']['id']." AND active = 'Y'");
257+
$rec_num = $app->db->queryOneRecord("SELECT count(id) as ns FROM dns_rr WHERE type = 'NS' AND zone = ".intval($data['new']['id'])." AND active = 'Y'");
258258
if($rec_num['ns'] == 0) {
259259
$exclude_zone = $data['new']['origin'];
260260
} else {

0 commit comments

Comments
 (0)