summaryrefslogtreecommitdiff
path: root/ext/phar/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/phar/stream.c')
-rw-r--r--ext/phar/stream.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ext/phar/stream.c b/ext/phar/stream.c
index a500758420..d50982babe 100644
--- a/ext/phar/stream.c
+++ b/ext/phar/stream.c
@@ -213,11 +213,11 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
if (idata->internal_file->uncompressed_filesize == 0
&& idata->internal_file->compressed_filesize == 0
&& (pzoption = zend_hash_str_find(pharcontext, "compress", sizeof("compress")-1)) != NULL
- && Z_TYPE_P(pzoption) == IS_INT
- && (Z_IVAL_P(pzoption) & ~PHAR_ENT_COMPRESSION_MASK) == 0
+ && Z_TYPE_P(pzoption) == IS_LONG
+ && (Z_LVAL_P(pzoption) & ~PHAR_ENT_COMPRESSION_MASK) == 0
) {
idata->internal_file->flags &= ~PHAR_ENT_COMPRESSION_MASK;
- idata->internal_file->flags |= Z_IVAL_P(pzoption);
+ idata->internal_file->flags |= Z_LVAL_P(pzoption);
}
if ((pzoption = zend_hash_str_find(pharcontext, "metadata", sizeof("metadata")-1)) != NULL) {
if (Z_TYPE(idata->internal_file->metadata) != IS_UNDEF) {
@@ -906,7 +906,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
memcmp(str_key->val, resource_from->path+1, from_len) == 0 &&
IS_SLASH(str_key->val[from_len])) {
- new_str_key = STR_ALLOC(str_key->len + to_len - from_len, 0);
+ new_str_key = zend_string_alloc(str_key->len + to_len - from_len, 0);
memcpy(new_str_key->val, resource_to->path + 1, to_len);
memcpy(new_str_key->val + to_len, str_key->val + from_len, str_key->len - from_len);
new_str_key->val[new_str_key->len] = 0;
@@ -918,8 +918,8 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
entry->filename = estrndup(new_str_key->val, new_str_key->len);
entry->filename_len = new_str_key->len;
- STR_RELEASE(str_key);
- b->h = STR_HASH_VAL(new_str_key);
+ zend_string_release(str_key);
+ b->h = zend_string_hash_val(new_str_key);
b->key = new_str_key;
}
} ZEND_HASH_FOREACH_END();
@@ -931,13 +931,13 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
memcmp(str_key->val, resource_from->path+1, from_len) == 0 &&
(str_key->len == from_len || IS_SLASH(str_key->val[from_len]))) {
- new_str_key = STR_ALLOC(str_key->len + to_len - from_len, 0);
+ new_str_key = zend_string_alloc(str_key->len + to_len - from_len, 0);
memcpy(new_str_key->val, resource_to->path + 1, to_len);
memcpy(new_str_key->val + to_len, str_key->val + from_len, str_key->len - from_len);
new_str_key->val[new_str_key->len] = 0;
- STR_RELEASE(str_key);
- b->h = STR_HASH_VAL(new_str_key);
+ zend_string_release(str_key);
+ b->h = zend_string_hash_val(new_str_key);
b->key = new_str_key;
}
} ZEND_HASH_FOREACH_END();
@@ -949,13 +949,13 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
memcmp(str_key->val, resource_from->path+1, from_len) == 0 &&
(str_key->len == from_len || IS_SLASH(str_key->val[from_len]))) {
- new_str_key = STR_ALLOC(str_key->len + to_len - from_len, 0);
+ new_str_key = zend_string_alloc(str_key->len + to_len - from_len, 0);
memcpy(new_str_key->val, resource_to->path + 1, to_len);
memcpy(new_str_key->val + to_len, str_key->val + from_len, str_key->len - from_len);
new_str_key->val[new_str_key->len] = 0;
- STR_RELEASE(str_key);
- b->h = STR_HASH_VAL(new_str_key);
+ zend_string_release(str_key);
+ b->h = zend_string_hash_val(new_str_key);
b->key = new_str_key;
}
} ZEND_HASH_FOREACH_END();