derick          Thu Apr  1 03:56:34 2004 EDT

  Added files:                 (Branch: PHP_4_3)
    /php-src/ext/standard/tests/general_functions       is_resource.phpt 

  Modified files:              
    /php-src/ext/standard       type.c 
    /php-src    NEWS 
  Log:
  - MFH: Fixed bug #27822 (is_resource() returns TRUE for closed resources)
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/type.c?r1=1.20.4.1&r2=1.20.4.2&ty=u
Index: php-src/ext/standard/type.c
diff -u php-src/ext/standard/type.c:1.20.4.1 php-src/ext/standard/type.c:1.20.4.2
--- php-src/ext/standard/type.c:1.20.4.1        Tue Dec 31 11:35:35 2002
+++ php-src/ext/standard/type.c Thu Apr  1 03:56:32 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: type.c,v 1.20.4.1 2002/12/31 16:35:35 sebastian Exp $ */
+/* $Id: type.c,v 1.20.4.2 2004/04/01 08:56:32 derick Exp $ */
 
 #include "php.h"
 #include "php_incomplete_class.h"
@@ -208,6 +208,13 @@
                                RETURN_FALSE;
                        }
                }
+               if (type == IS_RESOURCE) {
+                       char *type_name;
+                       type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(arg) 
TSRMLS_CC);
+                       if (!type_name) {
+                               RETURN_FALSE;
+                       }
+               }
                RETURN_TRUE;
        } else {
                RETURN_FALSE;
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.621&r2=1.1247.2.622&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.621 php-src/NEWS:1.1247.2.622
--- php-src/NEWS:1.1247.2.621   Wed Mar 31 18:27:40 2004
+++ php-src/NEWS        Thu Apr  1 03:56:33 2004
@@ -2,6 +2,7 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2004, Version 4.3.6
 - Synchronized bundled GD library with GD 2.0.22. (Ilia)
+- Fixed bug #27822 (is_resource() returns TRUE for closed resources). (Derick)
 - Fixed bug #25547 (error_handler and array index with function call). 
   (cschneid at cschneid dot com)
 - Fixed bug #27809 (ftp_systype returns null on some ftp servers). (Ilia)

http://cvs.php.net/co.php/php-src/ext/standard/tests/general_functions/is_resource.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/general_functions/is_resource.phpt
+++ php-src/ext/standard/tests/general_functions/is_resource.phpt
--TEST--
Bug #27822: is_resource() returns TRUE for closed resources
--FILE--
<?php
        $f = fopen(__FILE__, 'r');
        fclose($f);
        var_dump(is_resource($f));
?>
--EXPECT--
bool(false)

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

Reply via email to