Skip to content

Commit

Permalink
fix lookup correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrinth authored Feb 19, 2023
1 parent 9950fc1 commit ea99201
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/VirtualHostGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ private function buildHostList(\PDOStatement $statement, array &$virtualhosts, s
foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $row) {
$vhost = trim($row['name'] . '.' . $row['domain'], '.');
echo "Handling $vhost\n";
if (gethostbyname($vhost) !== $ip) {
if (gethostbyname($vhost . '.') !== $ip) {
continue;
}
if (gethostbyname('www.' . $vhost . '.') !== $ip) {
continue;
}
if (!$this->certificate($vhost . '.', $row['admin'])) {
if (!$this->certificate($vhost, $row['admin'])) {
continue;
}
if (!$this->certificate("www.$vhost.", $row['admin'])) {
if (!$this->certificate("www.$vhost", $row['admin'])) {
continue;
}
$virtualhosts[] = [
Expand Down

0 comments on commit ea99201

Please sign in to comment.