]> granicus.if.org Git - php/commitdiff
Fix spl_directory cast_object, reenable error
authorNikita Popov <nikic@php.net>
Mon, 12 May 2014 18:44:30 +0000 (20:44 +0200)
committerNikita Popov <nikic@php.net>
Mon, 12 May 2014 18:44:30 +0000 (20:44 +0200)
Zend/zend_execute.h
ext/spl/spl_directory.c

index 0007e98e672f4fa9bd865a6c8fce071757e8e1c9..52689d2d6a918f445cc9172918bb862fc6698451 100644 (file)
@@ -115,8 +115,7 @@ again:
                                                break;
                                        }
 
-                                       // TODO: The following line breakes phar ???
-                                       // zend_error(E_RECOVERABLE_ERROR, "Object of class %s could not be converted to boolean", Z_OBJ_P(op)->ce->name->val);
+                                       zend_error(E_RECOVERABLE_ERROR, "Object of class %s could not be converted to boolean", Z_OBJ_P(op)->ce->name->val);
                                } else if (Z_OBJ_HT_P(op)->get) {
                                        zval rv;
                                        zval *tmp = Z_OBJ_HT_P(op)->get(op, &rv TSRMLS_CC);
index 8cc7ec0b6dc7425dff5a7ccd40da793973a9675f..f7a1de4c07ba7e9d101de72c47651050d28d3131 100644 (file)
@@ -1881,6 +1881,9 @@ static int spl_filesystem_object_cast(zval *readobj, zval *writeobj, int type TS
                        }
                        return SUCCESS;
                }
+       } else if (type == _IS_BOOL) {
+               ZVAL_TRUE(writeobj);
+               return SUCCESS;
        }
        if (readobj == writeobj) {
                zval_dtor(readobj);