Skip to content

Commit bef146c

Browse files
committed
ext/phar: convert char to zend_string - phar_open_or_create_filename()
1 parent baaec0c commit bef146c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ext/phar/phar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,8 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 5, 6) zend_result phar_open_or_create_filename(ze
13121312
test = &unused;
13131313

13141314
*error = NULL;
1315+
const char *alias_cstr = alias ? ZSTR_VAL(alias) : NULL;
1316+
size_t alias_len = alias ? ZSTR_LEN(alias) : 0;
13151317

13161318
/* first try to open an existing file */
13171319
if (phar_detect_phar_fname_ext(ZSTR_VAL(fname), ZSTR_LEN(fname), &ext_str, &ext_len, !is_data, 0, true) == SUCCESS) {
@@ -1328,8 +1330,6 @@ ZEND_ATTRIBUTE_NONNULL_ARGS(1, 5, 6) zend_result phar_open_or_create_filename(ze
13281330
return FAILURE;
13291331
}
13301332
check_file:
1331-
const char *alias_cstr = alias ? ZSTR_VAL(alias) : NULL;
1332-
size_t alias_len = alias ? ZSTR_LEN(alias) : 0;
13331333
if (phar_open_parsed_phar(ZSTR_VAL(fname), ZSTR_LEN(fname), alias_cstr, alias_len, is_data, options, test, &my_error) == SUCCESS) {
13341334
*pphar = *test;
13351335

0 commit comments

Comments
 (0)