diff options
author | Derick Rethans <derick@php.net> | 2004-05-28 10:45:18 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2004-05-28 10:45:18 +0000 |
commit | f964cc09d2b4537c27c291fac1d2124f62fa1a3f (patch) | |
tree | 250e3ba7c4c8252e16ad935670a893205c81f5c4 | |
parent | 9797f494669a48fc965465efb9dc07960e536cb8 (diff) | |
download | php-git-f964cc09d2b4537c27c291fac1d2124f62fa1a3f.tar.gz |
- 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.
-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)); |