Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jul 22, 2021
1 parent ba20ea5 commit 2eb4649
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dns/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
die("Updated, nothing changed\n");
}
preg_match('/(IN\tSOA.+?)(\d+)/s', $replaced_file, $matches);
$replaced_file = preg_replace('/(IN\tSOA.+?)(\d+)/s', '$1'.(intval($matches[2]) + 1), $replaced_file, 1);
$replaced_file = preg_replace('/(IN\tSOA.+?)(\d+)/s', '${1}'.(intval($matches[2]) + 1), $replaced_file, 1);
if (!$replaced_file || file_put_contents($_SERVER['DNS_PATH'], $replaced_file, LOCK_EX) === false) {
die("ERROR: unable to write config\n");
}
Expand All @@ -53,7 +53,7 @@
die("Updated, Nothing changed\n");
}
preg_match('/(IN\tSOA.+?)(\d+)/s', $replaced_file, $matches);
$replaced_file = preg_replace('/(IN\tSOA.+?)(\d+)/s', '$1'.(intval($matches[2]) + 1), $replaced_file, 1);
$replaced_file = preg_replace('/(IN\tSOA.+?)(\d+)/s', '${1}'.(intval($matches[2]) + 1), $replaced_file, 1);
if (!$replaced_file || file_put_contents($_SERVER['DNS_PATH'], $replaced_file, LOCK_EX) === false) {
die("ERROR: unable to write config\n");
}
Expand Down

0 comments on commit 2eb4649

Please sign in to comment.