mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07: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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user