Commit c68b307e authored by quovadis (service account)'s avatar quovadis (service account)
Browse files

Fix query of TXT records for RFC2136 functions

parent e06633f2
......@@ -54,7 +54,7 @@ function get_rfc2136_txt($config, $name) {
} catch(Net_DNS2_Exception $e) {
echo "::query() failed: ", $e->getMessage(), "\n";
#echo "::query() failed: ", $e->getMessage(), "\n";
return "";
}
......@@ -63,7 +63,9 @@ function get_rfc2136_txt($config, $name) {
//
foreach($result->answer as $txtrr)
{
return $txtrr;
$answer = $txtrr->asArray();
$txt = trim(end($answer),'"');
return $txt;
}
//
......@@ -232,7 +234,7 @@ function delete_rfc2136_txt($config, $name) {
} catch(Net_DNS2_Exception $e) {
echo "::update() for deleteAny failed: ", $e->getMessage(), "\n";
#echo "::update() for deleteAny failed: ", $e->getMessage(), "\n";
}
return "";
......@@ -252,6 +254,8 @@ function update_rfc2136_txt($config, $name, $txt) {
//
$txtrr = Net_DNS2_RR::fromString($name . "." . $config['QV_DOMAIN'] . ' TXT "'. $txt . '"');
$txtrr->ttl=60;
//
// add the record
//
......@@ -270,7 +274,7 @@ function update_rfc2136_txt($config, $name, $txt) {
} catch(Net_DNS2_Exception $e) {
echo "::update() failed: ", $e->getMessage(), "\n";
#echo "::update() failed: ", $e->getMessage(), "\n";
}
return "";
......
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