derick          Fri May 28 06:45:19 2004 EDT

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/standard       basic_functions.c 
  Log:
  - 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.
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1719&r2=1.1720&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1719 php-src/NEWS:1.1720
--- php-src/NEWS:1.1719 Thu May 27 08:28:41 2004
+++ php-src/NEWS        Fri May 28 06:45:18 2004
@@ -8,6 +8,8 @@
 - 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).
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.668&r2=1.669&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.668 
php-src/ext/standard/basic_functions.c:1.669
--- php-src/ext/standard/basic_functions.c:1.668        Wed May 26 14:00:27 2004
+++ php-src/ext/standard/basic_functions.c      Fri May 28 06:45:18 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.668 2004/05/26 18:00:27 andi Exp $ */
+/* $Id: basic_functions.c,v 1.669 2004/05/28 10:45:18 derick Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1247,7 +1247,7 @@
        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));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to