mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
dns/dnscrypt-proxy: fix regex of course
We don't need non-capture groups so simplify a bit and fetch the second capture group with the port.
This commit is contained in:
parent
53bd339164
commit
73abcfe3b5
1 changed files with 2 additions and 2 deletions
|
|
@ -51,8 +51,8 @@ function dnscryptproxy_services()
|
|||
$ports = [];
|
||||
|
||||
foreach (explode(',', (string)$model->listen_addresses) as $addrport) {
|
||||
if (preg_match('/^(?:(\[.+\]:)|([\d\.]+:))[\d]+$/', $addrport, $matches)) {
|
||||
$ports[$matches[1]] = 1;
|
||||
if (preg_match('/^(\[.+\]|[\d\.]+):([\d]+)$/', $addrport, $matches)) {
|
||||
$ports[$matches[2]] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue