no need for quotemeta

This commit is contained in:
Oliver Gorwits
2018-04-09 23:15:58 +01:00
parent 9d48c4a025
commit 9339c1a2ce

View File

@@ -261,7 +261,7 @@ sub store_neighbors {
{'=', $remote_port}, {'=', $remote_port},
{'-ilike', long_port($remote_port)}, {'-ilike', long_port($remote_port)},
{'-ilike', short_port($remote_port)}, {'-ilike', short_port($remote_port)},
{'-ilike', ('%'.quotemeta($remote_port))}, {'-ilike', ('%'. $remote_port)},
], ],
}, { rows => 1 })->single(); }, { rows => 1 })->single();
if ($peer_port and ($peer_port->port ne $remote_port)) { if ($peer_port and ($peer_port->port ne $remote_port)) {
@@ -311,7 +311,7 @@ sub store_neighbors {
sub long_port { sub long_port {
my $port = shift or return ''; my $port = shift or return '';
$port =~ s/^([a-z]{2})([^a-z].+)$/$1%$2/i; $port =~ s/^([a-z]{2})(\d.+)$/$1%$2/i;
return $port; return $port;
} }