parent
4687bff96d
commit
9cfc9f359b
|
@ -220,7 +220,11 @@ class m_bind {
|
||||||
global $db;
|
global $db;
|
||||||
$db->query("
|
$db->query("
|
||||||
SELECT
|
SELECT
|
||||||
REPLACE(REPLACE(dt.entry,'%TARGET%',sd.valeur), '%SUB%', if(length(sd.sub)>0,sd.sub,'@')) AS ENTRY
|
REPLACE(REPLACE(dt.entry,'%TARGET%',sd.valeur), '%SUB%', if(length(sd.sub)>0,sd.sub,'@')) AS ENTRY,
|
||||||
|
dt.target AS TARGET,
|
||||||
|
dt.entry AS ORIGINAL_ENTRY,
|
||||||
|
sd.valeur AS VALEUR,
|
||||||
|
if(length(sd.sub)>0,sd.sub,'@') AS SUB
|
||||||
FROM
|
FROM
|
||||||
sub_domaines sd,
|
sub_domaines sd,
|
||||||
domaines_type dt
|
domaines_type dt
|
||||||
|
@ -232,7 +236,30 @@ class m_bind {
|
||||||
ORDER BY ENTRY ;", array($domain));
|
ORDER BY ENTRY ;", array($domain));
|
||||||
$t="";
|
$t="";
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
$t.= $db->f('ENTRY')."\n";
|
// TXT entries may be longer than 255 characters, but need
|
||||||
|
// special treatment. @see https://kb.isc.org/docs/aa-00356
|
||||||
|
if (strlen($db->f('VALEUR')) >= 256 && $db->f('TARGET') == 'TXT') {
|
||||||
|
$chunks = str_split($db->f('VALEUR'), 255);
|
||||||
|
if ($chunks !== FALSE) {
|
||||||
|
$new_entry = '';
|
||||||
|
foreach ($chunks as $chunk) {
|
||||||
|
$new_entry .= '"' . $chunk . '" ';
|
||||||
|
}
|
||||||
|
$new_entry = trim($new_entry, ' ');
|
||||||
|
$entry = strtr($db->f('ORIGINAL_ENTRY'), array(
|
||||||
|
'%SUB%' => $db->f('SUB'),
|
||||||
|
// Don't want extra double quotes in this case
|
||||||
|
'"%TARGET%"' => $new_entry,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$entry = $db->f('ENTRY');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$entry = $db->f('ENTRY');
|
||||||
|
}
|
||||||
|
$t.= $entry . "\n";
|
||||||
}
|
}
|
||||||
return $t;
|
return $t;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue