Skip to content

Commit

Permalink
fix weird lookup bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrinth authored Feb 19, 2023
1 parent 7402ef9 commit 9950fc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/VirtualHostGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ private function buildHostList(\PDOStatement $statement, array &$virtualhosts, s
if (gethostbyname($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 Expand Up @@ -77,10 +77,10 @@ private function buildDefaultHostList(\PDOStatement $statement, array &$virtualh
foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $row) {
$vhost = 'default.' . $row['domain'];
echo "Handling $vhost\n";
if (gethostbyname($row['domain']) !== $ip) {
if (gethostbyname($row['domain'] . '.') !== $ip) {
continue;
}
if (gethostbyname($vhost) !== $ip) {
if (gethostbyname($vhost . '.') !== $ip) {
continue;
}
if (!$this->certificate($vhost, $row['admin'])) {
Expand Down

0 comments on commit 9950fc1

Please sign in to comment.