Explorar el Código

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

emanuele hace 13 años
padre
commit
d2f9c30813
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  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++)