From 1a2cbfbf0cd666af05c28c3a7e51de3fb59bdd99 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Wed, 20 Nov 2013 03:34:56 -0500
Subject: [PATCH] Merge remote-tracking branch 'origin/stable-3.0.5'

---
 interface/web/tools/dns_import_tupa.php |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/interface/web/tools/dns_import_tupa.php b/interface/web/tools/dns_import_tupa.php
index 940a851..775d515 100644
--- a/interface/web/tools/dns_import_tupa.php
+++ b/interface/web/tools/dns_import_tupa.php
@@ -89,15 +89,15 @@
 				$soa = $exdb->queryOneRecord("SELECT * FROM records WHERE type = 'SOA' AND domain_id = ".$domain['id']);
 				if(is_array($soa)) {
 					$parts = explode(' ', $soa['content']);
-					$origin = addot($soa['name']);
-					$ns = addot($parts[0]);
-					$mbox = addot($parts[1]);
-					$serial = $parts[2];
+					$origin = $app->db->quote(addot($soa['name']));
+					$ns = $app->db->quote(addot($parts[0]));
+					$mbox = $app->db->quote(addot($parts[1]));
+					$serial = $app->db->quote($parts[2]);
 					$refresh = 7200;
 					$retry =  540;
 					$expire = 604800;
 					$minimum = 86400;
-					$ttl = $soa['ttl'];
+					$ttl = $app->db->quote($soa['ttl']);
 
 					$insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `origin`, `ns`, `mbox`, `serial`, `refresh`, `retry`, `expire`, `minimum`, `ttl`, `active`, `xfer`) VALUES
 					('$sys_userid', '$sys_groupid', 'riud', 'riud', '', '$server_id', '$origin', '$ns', '$mbox', '$serial', '$refresh', '$retry', '$expire', '$minimum', '$ttl', 'Y', '')";
@@ -111,15 +111,15 @@
 						foreach($records as $rec) {
 							$rr = array();
 
-							$rr['name'] = addot($rec['name']);
-							$rr['type'] = $rec['type'];
-							$rr['aux'] = $rec['prio'];
-							$rr['ttl'] = $rec['ttl'];
+							$rr['name'] = $app->db->quote(addot($rec['name']));
+							$rr['type'] = $app->db->quote($rec['type']);
+							$rr['aux'] = $app->db->quote($rec['prio']);
+							$rr['ttl'] = $app->db->quote($rec['ttl']);
 
 							if($rec['type'] == 'NS' || $rec['type'] == 'MX' || $rec['type'] == 'CNAME') {
-								$rr['data'] = addot($rec['content']);
+								$rr['data'] = $app->db->quote(addot($rec['content']));
 							} else {
-								$rr['data'] = $rec['content'];
+								$rr['data'] = $app->db->quote($rec['content']);
 							}
 
 							$insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `zone`, `name`, `type`, `data`, `aux`, `ttl`, `active`) VALUES

--
Gitblit v1.9.1