Commit 25242a21 authored by Falko Timme's avatar Falko Timme
Browse files

- DNS/Import zone file: fixed problem with double quotes around TXT records.

parent cba4587d
......@@ -256,6 +256,12 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'
$dns_rr[$r]['aux'] = intval($parts[$pkey+1]);
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+2));
break;
case 'txt':
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
if(substr($dns_rr[$r]['data'],0,1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],1);
if(substr($dns_rr[$r]['data'],-1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],0,-1);
break;
default:
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
......@@ -274,6 +280,12 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'
$dns_rr[$r]['aux'] = intval($parts[$pkey+1]);
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+2));
break;
case 'txt':
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
if(substr($dns_rr[$r]['data'],0,1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],1);
if(substr($dns_rr[$r]['data'],-1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],0,-1);
break;
default:
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
......@@ -292,6 +304,12 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'
$dns_rr[$r]['aux'] = intval($parts[$pkey+1]);
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+2));
break;
case 'txt':
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
if(substr($dns_rr[$r]['data'],0,1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],1);
if(substr($dns_rr[$r]['data'],-1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],0,-1);
break;
default:
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
......@@ -310,6 +328,12 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'
$dns_rr[$r]['aux'] = intval($parts[$pkey+1]);
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+2));
break;
case 'txt':
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
if(substr($dns_rr[$r]['data'],0,1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],1);
if(substr($dns_rr[$r]['data'],-1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],0,-1);
break;
default:
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
......@@ -330,6 +354,12 @@ if(isset($_FILES['file']['name']) && is_uploaded_file($_FILES['file']['tmp_name'
$dns_rr[$r]['aux'] = intval($parts[$pkey+1]);
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+2));
break;
case 'txt':
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
if(substr($dns_rr[$r]['data'],0,1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],1);
if(substr($dns_rr[$r]['data'],-1) == '"') $dns_rr[$r]['data'] = substr($dns_rr[$r]['data'],0,-1);
break;
default:
$dns_rr[$r]['aux'] = 0;
$dns_rr[$r]['data'] = implode(' ',array_slice($parts, $pkey+1));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment