From 531afabaf5f8b923798dcad165012d0622d557f9 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Sun, 26 Sep 2010 18:12:35 +0000
Subject: [PATCH] Fixes in BIND plugin when zones get deleted.

---
 server/plugins-available/bind_plugin.inc.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/bind_plugin.inc.php b/server/plugins-available/bind_plugin.inc.php
index 02a301a6a0..7a8c6cd94f 100644
--- a/server/plugins-available/bind_plugin.inc.php
+++ b/server/plugins-available/bind_plugin.inc.php
@@ -236,7 +236,7 @@ class bind_plugin {
 		global $app, $conf;
 		
 		//* Get the data of the soa and call soa_update
-		$tmp = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ".$data['old']['zone']);
+		$tmp = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ".intval($data['old']['zone']));
 		$data["new"] = $tmp;
 		$data["old"] = $tmp;
 		$this->action = 'update';
@@ -254,7 +254,7 @@ class bind_plugin {
 		$zones = array();
 		
 		//* Check if the current zone that triggered this function has at least one NS record
-		$rec_num = $app->db->queryOneRecord("SELECT count(id) as ns FROM dns_rr WHERE type = 'NS' AND zone = ".$data['new']['id']." AND active = 'Y'");
+		$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'");
 		if($rec_num['ns'] == 0) {
 			$exclude_zone = $data['new']['origin'];
 		} else {
-- 
GitLab