1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

- Fixed ip2long() behavior if an invalid IP address was passed to the

function. This makes it possible to distingiush between "255.255.255.255"
  and a wrong one.
This commit is contained in:
Derick Rethans
2004-05-28 10:45:18 +00:00
parent 9797f49466
commit f964cc09d2
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -8,6 +8,8 @@ PHP NEWS
- Changed class type hints for function parameters to not allow the passing of
NULL values. (Andi)
- Changed tidy_node to tidyNode and removed tidy_exception. (John)
- Fixed ip2long() to return FALSE if an IP address passed to this function
is not valid. (Derick)
- Fixed memory leak in memory manager. (Andi)
- Fixed problem with exceptions returning from include(). (Dmitry)
- Fixed bug #28311 (Transparency detection code is off by 1).
+1 -1
View File
@@ -1247,7 +1247,7 @@ PHP_FUNCTION(ip2long)
convert_to_string_ex(str);
if (Z_STRLEN_PP(str) == 0 || (ip = inet_addr(Z_STRVAL_PP(str))) == INADDR_NONE) {
RETURN_LONG(-1);
RETURN_FALSE;
}
RETURN_LONG(ntohl(ip));