Suggest to fix checkUserIp
-
I am using ver.1.2.5.0 and I found bug in function checkUserIp, so I suggest the following fix.
UamAccessHandler.class.php – 668
if ($aRangeBegin[0] <= $aCurIp[0] && $aCurIp[0] <= $aRangeEnd[0] && $aRangeBegin[1] <= $aCurIp[1] && $aCurIp[1] <= $aRangeEnd[1] && $aRangeBegin[2] <= $aCurIp[2] && $aCurIp[2] <= $aRangeEnd[2] && $aRangeBegin[3] <= $aCurIp[3] && $aCurIp[3] <= $aRangeEnd[3]
would have to change to
if (($aRangeBegin[0] << 24) + ($aRangeBegin[1] << 16) + ($aRangeBegin[2] << 8) + $aRangeBegin[3] <= ($aCurIp[0] << 24) + ($aCurIp[1] << 16) + ($aCurIp[2] << 8) + $aCurIp[3] && ($aCurIp[0] << 24) + ($aCurIp[1] << 16) + ($aCurIp[2] << 8) + $aCurIp[3] <= ($aRangeEnd[0] << 24) + ($aRangeEnd[1] << 16) + ($aRangeEnd[2] << 8) + $aRangeEnd[3]
for in case like
IP range: 1.1.1.0-1.1.1.127;1.1.1.129-1.1.2.255
Users IP: 1.1.2.1
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Suggest to fix checkUserIp’ is closed to new replies.