# HG changeset patch # User rejo # Date 1206525765 0 # Node ID fa948cc3727e178fa0fb94136143dc0a83b24627 # Parent 654262e698e29fcbddf906000e11d50e1fc0b80d [feladat @ 188] Improved error checking of delete_domain function. The ticket:25 has been opened, this is still a problem. diff -r 654262e698e2 -r fa948cc3727e inc/record.inc.php --- a/inc/record.inc.php Wed Mar 26 09:31:12 2008 +0000 +++ b/inc/record.inc.php Wed Mar 26 10:02:45 2008 +0000 @@ -606,14 +606,21 @@ WHERE domains.id = " . $db->quote($zone_id) . " AND domains.id = records.domain_id GROUP BY domains.id"; + $result = $db->query($query); + if (PEAR::isError($result)) { error($result->getMessage()); return false; } - $response = $db->queryRow($query); - if (PEAR::isError($response)) { error($response->getMessage()); return false; } - $return = array( - "name" => $response['name'], - "type" => $response['type'], - "master_ip" => $response['master_ip'], - "record_count" => $response['record_count']); + if($result->numRows() != 1) { + error(_('Function returned an error (multiple zones matching this zone ID).')); + return false; + } else { + $r = $result->fetchRow(); + $return = array( + "name" => $r['name'], + "type" => $r['type'], + "master_ip" => $r['master_ip'], + "record_count" => $r['record_count'] + ); + } return $return; } }