helly Mon Jun 2 15:49:03 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/phar phar_object.c
Log:
- Need to use a proper inheritance check
http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar_object.c?r1=1.266.2.15&r2=1.266.2.16&diff_format=u
Index: php-src/ext/phar/phar_object.c
diff -u php-src/ext/phar/phar_object.c:1.266.2.15
php-src/ext/phar/phar_object.c:1.266.2.16
--- php-src/ext/phar/phar_object.c:1.266.2.15 Sun Jun 1 17:14:48 2008
+++ php-src/ext/phar/phar_object.c Mon Jun 2 15:49:03 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: phar_object.c,v 1.266.2.15 2008/06/01 17:14:48 helly Exp $ */
+/* $Id: phar_object.c,v 1.266.2.16 2008/06/02 15:49:03 helly Exp $ */
#include "phar_internal.h"
#include "func_interceptors.h"
@@ -1114,7 +1114,7 @@
#if !HAVE_SPL
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0
TSRMLS_CC, "Cannot instantiate Phar object without SPL extension");
#else
- char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL,
*save_fname, *objname;
+ char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL,
*save_fname;
int fname_len, alias_len = 0, arch_len, entry_len, is_data;
long flags = 0, format = 0;
phar_archive_object *phar_obj;
@@ -1123,13 +1123,7 @@
phar_obj = (phar_archive_object*)zend_object_store_get_object(getThis()
TSRMLS_CC);
- PHAR_STR(phar_obj->std.ce->name, objname);
-
- if (!strncmp(objname, "PharData", 8)) {
- is_data = 1;
- } else {
- is_data = 0;
- }
+ is_data = instanceof_function(Z_OBJCE_P(zobj), phar_ce_data TSRMLS_CC);
if (is_data) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!l",
&fname, &fname_len, &flags, &alias, &alias_len, &format) == FAILURE) {
@@ -1166,7 +1160,6 @@
}
if (phar_open_or_create_filename(fname, fname_len, alias, alias_len,
is_data, REPORT_ERRORS, &phar_data, &error TSRMLS_CC) == FAILURE) {
-
if (fname == arch) {
efree(arch);
fname = save_fname;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php