dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3deb77
)
Fix weird bug that caused IP::isInRange("80.0.0.0", "94.0.0.0/24") to return true...
author
Roan Kattouw
<catrope@users.mediawiki.org>
Sun, 31 May 2009 14:52:16 +0000
(14:52 +0000)
committer
Roan Kattouw
<catrope@users.mediawiki.org>
Sun, 31 May 2009 14:52:16 +0000
(14:52 +0000)
includes/IP.php
patch
|
blob
|
history
diff --git
a/includes/IP.php
b/includes/IP.php
index
a208542
..
355c7b6
100644
(file)
--- a/
includes/IP.php
+++ b/
includes/IP.php
@@
-502,9
+502,10
@@
class IP {
*/
public static function isInRange( $addr, $range ) {
// Convert to IPv6 if needed
- $unsignedIP = self::to
Hex
( $addr );
+ $unsignedIP = self::to
Unsigned
( $addr );
list( $start, $end ) = self::parseRange( $range );
- return (($unsignedIP >= $start) && ($unsignedIP <= $end));
+ return (($unsignedIP >= base_convert($start, 16, 10)) &&
+ ($unsignedIP <= base_convert($end, 16, 10)));
}
/**