diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/standard/basic_functions.c | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -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). diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 6fcab6d761..425d6a494f 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -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)); |