mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-10-03 09:49:14 +02:00
actually support the short CIDR notation
This commit is contained in:
parent
6b001b5e4a
commit
3e02818335
2 changed files with 6 additions and 3 deletions
|
@ -146,7 +146,10 @@ class TrafficLimiter extends AbstractPersistence
|
|||
$ipRange = trim($ipRange);
|
||||
}
|
||||
$address = Factory::parseAddressString($_SERVER[self::$_ipKey]);
|
||||
$range = Factory::parseRangeString($ipRange, ParseStringFlag::IPV4_MAYBE_NON_DECIMAL);
|
||||
$range = Factory::parseRangeString(
|
||||
$ipRange,
|
||||
ParseStringFlag::IPV4_MAYBE_NON_DECIMAL | ParseStringFlag::IPV4SUBNET_MAYBE_COMPACT | ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED
|
||||
);
|
||||
|
||||
// address could not be parsed, we might not be in IP space and try a string comparison instead
|
||||
if (is_null($address)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue