Common subdirectories: imagick-3.0.1/examples and imagick-3.0.1-3/examples diff -u imagick-3.0.1/imagick.c imagick-3.0.1-3/imagick.c --- imagick-3.0.1/imagick.c 2010-11-19 05:16:01.000000000 +0800 +++ imagick-3.0.1-3/imagick.c 2012-05-10 09:05:51.000000000 +0800 @@ -2374,7 +2374,11 @@ /* ALLOC_HASHTABLE(intern->zo.properties); */ zend_object_std_init(&intern->zo, class_type TSRMLS_CC); +#if PHP_VERSION_ID < 50399 zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); +#else + object_properties_init(&(intern->zo), class_type); +#endif retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagick_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) &imagick_object_handlers; @@ -2409,7 +2413,11 @@ /* ALLOC_HASHTABLE(intern->zo.properties); */ zend_object_std_init(&intern->zo, class_type TSRMLS_CC); +#if PHP_VERSION_ID < 50399 zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); +#else + object_properties_init(&(intern->zo), class_type); +#endif retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickdraw_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) &imagickdraw_object_handlers; @@ -2443,7 +2451,11 @@ /* ALLOC_HASHTABLE(intern->zo.properties); */ zend_object_std_init(&intern->zo, class_type TSRMLS_CC); +#if PHP_VERSION_ID < 50399 zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); +#else + object_properties_init(&(intern->zo), class_type); +#endif retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickpixeliterator_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) &imagickpixeliterator_object_handlers; @@ -2471,7 +2483,11 @@ /* ALLOC_HASHTABLE(intern->zo.properties); */ zend_object_std_init(&intern->zo, class_type TSRMLS_CC); +#if PHP_VERSION_ID < 50399 zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); +#else + object_properties_init(&(intern->zo), class_type); +#endif retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) php_imagickpixel_object_free_storage, NULL TSRMLS_CC); retval.handlers = (zend_object_handlers *) &imagickpixel_object_handlers; diff -u imagick-3.0.1/imagick_helpers.c imagick-3.0.1-3/imagick_helpers.c --- imagick-3.0.1/imagick_helpers.c 2010-11-19 05:16:01.000000000 +0800 +++ imagick-3.0.1-3/imagick_helpers.c 2012-05-10 09:02:42.000000000 +0800 @@ -723,9 +723,11 @@ int php_imagick_safe_mode_check(const char *filename TSRMLS_DC) { +#if PHP_VERSION_ID < 50399 if (PG(safe_mode) && (!php_checkuid_ex(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR, CHECKUID_NO_ERRORS))) { return IMAGICK_READ_WRITE_SAFE_MODE_ERROR; } +#endif if (PG(open_basedir) && php_check_open_basedir_ex(filename, 0 TSRMLS_CC)) { return IMAGICK_READ_WRITE_OPEN_BASEDIR_ERROR; diff -u imagick-3.0.1/imagick_read.c imagick-3.0.1-3/imagick_read.c --- imagick-3.0.1/imagick_read.c 2010-11-19 05:16:01.000000000 +0800 +++ imagick-3.0.1-3/imagick_read.c 2012-05-10 09:03:18.000000000 +0800 @@ -176,7 +176,11 @@ { int status = IMAGICK_READ_WRITE_NO_ERROR; +#if PHP_VERSION_ID < 50399 if (PG(open_basedir) || PG(safe_mode)) { +#else + if (PG(open_basedir)) { +#endif char *absolute = php_imagick_get_absolute_filename(filename, filename_len TSRMLS_CC); if (absolute) { diff -u imagick-3.0.1/php_imagick_macros.h imagick-3.0.1-3/php_imagick_macros.h --- imagick-3.0.1/php_imagick_macros.h 2010-11-19 05:16:01.000000000 +0800 +++ imagick-3.0.1-3/php_imagick_macros.h 2012-05-10 09:02:07.000000000 +0800 @@ -145,6 +145,7 @@ value = (type)NULL; \ } \ +#if PHP_VERSION_ID < 50399 #define IMAGICK_SAFE_MODE_CHECK(filename_, status_)\ if (filename_) { \ if (strlen(filename_) > MAXPATHLEN) { \ @@ -156,7 +157,18 @@ if (php_check_open_basedir_ex(filename_, 0 TSRMLS_CC)) { \ status_ = IMAGICK_READ_WRITE_OPEN_BASEDIR_ERROR; \ } \ - } \ + } +#else +#define IMAGICK_SAFE_MODE_CHECK(filename_, status_)\ + if (filename_) { \ + if (strlen(filename_) > MAXPATHLEN) { \ + status_ = IMAGICK_READ_WRITE_FILENAME_TOO_LONG; \ + } \ + if (php_check_open_basedir_ex(filename_, 0 TSRMLS_CC)) { \ + status_ = IMAGICK_READ_WRITE_OPEN_BASEDIR_ERROR; \ + } \ + } +#endif #define IMAGICK_HAS_FORMAT(buffer, magick_wand, free_buffer)\ buffer = MagickGetImageFormat(magick_wand);\ .