From 6cfff6d2946b49c8856921f188ed1de1b1fcc728 Mon Sep 17 00:00:00 2001 From: Nigel Kukard <nkukard@lbsd.net> Date: Sun, 3 Feb 2013 16:11:14 +0000 Subject: [PATCH] Small code fixes & cleanup Change-Id: If2b66a9ecedff914469e220964ccd28b1efbce95 --- modules/registrars/cozaepp/cozaepppoll.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/registrars/cozaepp/cozaepppoll.php b/modules/registrars/cozaepp/cozaepppoll.php index 23192fc..1b5f7a2 100644 --- a/modules/registrars/cozaepp/cozaepppoll.php +++ b/modules/registrars/cozaepp/cozaepppoll.php @@ -72,7 +72,7 @@ if (PEAR::isError($client = _cozaepp_Client())) { # Loop with message queue while (!$last) { # Request messages - $output= $client->request(' + $request = $client->request(' <epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> <command> <poll op="req"/> @@ -82,7 +82,7 @@ while (!$last) { # Decode response $doc= new DOMDocument(); - $doc->loadXML($output); + $doc->loadXML($request); # Pull off code $coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code'); @@ -97,10 +97,13 @@ while (!$last) { $last = 1; } - $msgid = $doc->getElementsByTagName('msgQ')->item(0)->getAttribute('id'); - $res = _cozaepp_ackpoll($client,$msgid); - if (PEAR::isError($res)) { - echo("ERROR: ".$res->getMessage()."\n"); + $msgq = $doc->getElementsByTagName('msgQ')->item(0); + if ($msgq) { + $msgid = $doc->getElementsByTagName('msgQ')->item(0)->getAttribute('id'); + $res = _cozaepp_ackpoll($client,$msgid); + if (PEAR::isError($res)) { + echo("ERROR: ".$res->getMessage()."\n"); + } } } else { @@ -109,7 +112,7 @@ while (!$last) { for ($m = 0; $m < $msgs->length; $m++) { echo "\n"; echo "UNKNOWN CODE: $coderes, MESSAGE: '".$msgs->item($m)->textContent."', ID: $msgid\n"; - echo $output; + echo $request; echo "\n\n"; } -- GitLab