Browse Source

! Fix IPv4 addresses visualization in banned entities table (ban edit)

emanuele 12 years ago
parent
commit
d2f9c30813
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Sources/ManageBans.php

+ 4 - 2
Sources/ManageBans.php

@@ -1643,8 +1643,10 @@ function range2ip($low, $high)
 	}
 
 	// Legacy IPv4 stuff.
-	if (count($low) != 4 || count($high) != 4)
-		return '';
+	// (count($low) != 4 || count($high) != 4) would not work because $low and $high always contain 8 elements!
+	for ($i = 4; $i < 8; $i++)
+		if (!empty($low[$i]) || !empty($high[$i]))
+			return '';
 
 	$ip = array();
 	for ($i = 0; $i < 4; $i++)