diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index d7beb43de39..96376a3f4ac 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1669,7 +1669,21 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ case SPL_FS_INFO: case SPL_FS_FILE: #if PHP_VERSION_ID >= 60000 - fname = expand_filepath(intern->file_name.s, NULL TSRMLS_CC); + if (intern->file_name_type == IS_UNICODE) { + zval zv; + + INIT_ZVAL(zv); + Z_UNIVAL(zv) = intern->file_name; + Z_UNILEN(zv) = intern->file_name_len; + Z_TYPE(zv) = IS_UNICODE; + + zval_copy_ctor(&zv); + zval_unicode_to_string(&zv TSRMLS_CC); + fname = expand_filepath(Z_STRVAL(zv), NULL TSRMLS_CC); + ezfree(Z_UNIVAL(zv)); + } else { + fname = expand_filepath(intern->file_name.s, NULL TSRMLS_CC); + } #else fname = expand_filepath(intern->file_name, NULL TSRMLS_CC); #endif diff --git a/ext/phar/tests/phar_buildfromiterator10.phpt b/ext/phar/tests/phar_buildfromiterator10.phpt index 02c31e567f2..024277ed0ac 100644 --- a/ext/phar/tests/phar_buildfromiterator10.phpt +++ b/ext/phar/tests/phar_buildfromiterator10.phpt @@ -31,74 +31,74 @@ __HALT_COMPILER(); --EXPECTF-- array(35) { ["phar_ctx_001.phpt"]=> - %unicode|string%(%d) "%sphar_ctx_001.phpt" + string(%d) "%sphar_ctx_001.phpt" ["phar_get_supported_signatures_001.phpt"]=> - %unicode|string%(%d) "%sphar_get_supported_signatures_001.phpt" + string(%d) "%sphar_get_supported_signatures_001.phpt" ["phar_get_supported_signatures_002.phpt"]=> - %unicode|string%(%d) "%sphar_get_supported_signatures_002.phpt" + string(%d) "%sphar_get_supported_signatures_002.phpt" ["phar_oo_001.phpt"]=> - %unicode|string%(%d) "%sphar_oo_001.phpt" + string(%d) "%sphar_oo_001.phpt" ["phar_oo_002.phpt"]=> - %unicode|string%(%d) "%sphar_oo_002.phpt" + string(%d) "%sphar_oo_002.phpt" ["phar_oo_003.phpt"]=> - %unicode|string%(%d) "%sphar_oo_003.phpt" + string(%d) "%sphar_oo_003.phpt" ["phar_oo_004.phpt"]=> - %unicode|string%(%d) "%sphar_oo_004.phpt" + string(%d) "%sphar_oo_004.phpt" ["phar_oo_005.phpt"]=> - %unicode|string%(%d) "%sphar_oo_005.phpt" + string(%d) "%sphar_oo_005.phpt" ["phar_oo_006.phpt"]=> - %unicode|string%(%d) "%sphar_oo_006.phpt" + string(%d) "%sphar_oo_006.phpt" ["phar_oo_007.phpt"]=> - %unicode|string%(%d) "%sphar_oo_007.phpt" + string(%d) "%sphar_oo_007.phpt" ["phar_oo_008.phpt"]=> - %unicode|string%(%d) "%sphar_oo_008.phpt" + string(%d) "%sphar_oo_008.phpt" ["phar_oo_009.phpt"]=> - %unicode|string%(%d) "%sphar_oo_009.phpt" + string(%d) "%sphar_oo_009.phpt" ["phar_oo_010.phpt"]=> - %unicode|string%(%d) "%sphar_oo_010.phpt" + string(%d) "%sphar_oo_010.phpt" ["phar_oo_011.phpt"]=> - %unicode|string%(%d) "%sphar_oo_011.phpt" + string(%d) "%sphar_oo_011.phpt" ["phar_oo_012.phpt"]=> - %unicode|string%(%d) "%sphar_oo_012.phpt" + string(%d) "%sphar_oo_012.phpt" ["phar_oo_compressed_001.phpt"]=> - %unicode|string%(%d) "%sphar_oo_compressed_001.phpt" + string(%d) "%sphar_oo_compressed_001.phpt" ["phar_oo_compressed_002.phpt"]=> - %unicode|string%(%d) "%sphar_oo_compressed_002.phpt" + string(%d) "%sphar_oo_compressed_002.phpt" ["phpinfo_001.phpt"]=> - %unicode|string%(%d) "%sphpinfo_001.phpt" + string(%d) "%sphpinfo_001.phpt" ["phpinfo_002.phpt"]=> - %unicode|string%(%d) "%sphpinfo_002.phpt" + string(%d) "%sphpinfo_002.phpt" ["phpinfo_003.phpt"]=> - %unicode|string%(%d) "%sphpinfo_003.phpt" + string(%d) "%sphpinfo_003.phpt" ["phpinfo_004.phpt"]=> - %unicode|string%(%d) "%sphpinfo_004.phpt" + string(%d) "%sphpinfo_004.phpt" ["tar/tar_001.phpt"]=> - %unicode|string%(%d) "%star%ctar_001.phpt" + string(%d) "%star%ctar_001.phpt" ["tar/tar_002.phpt"]=> - %unicode|string%(%d) "%star%ctar_002.phpt" + string(%d) "%star%ctar_002.phpt" ["tar/tar_003.phpt"]=> - %unicode|string%(%d) "%star%ctar_003.phpt" + string(%d) "%star%ctar_003.phpt" ["tar/tar_004.phpt"]=> - %unicode|string%(%d) "%star%ctar_004.phpt" + string(%d) "%star%ctar_004.phpt" ["zip/corrupt_001.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_001.phpt" + string(%d) "%szip%ccorrupt_001.phpt" ["zip/corrupt_002.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_002.phpt" + string(%d) "%szip%ccorrupt_002.phpt" ["zip/corrupt_003.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_003.phpt" + string(%d) "%szip%ccorrupt_003.phpt" ["zip/corrupt_004.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_004.phpt" + string(%d) "%szip%ccorrupt_004.phpt" ["zip/corrupt_005.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_005.phpt" + string(%d) "%szip%ccorrupt_005.phpt" ["zip/corrupt_006.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_006.phpt" + string(%d) "%szip%ccorrupt_006.phpt" ["zip/corrupt_007.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_007.phpt" + string(%d) "%szip%ccorrupt_007.phpt" ["zip/corrupt_008.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_008.phpt" + string(%d) "%szip%ccorrupt_008.phpt" ["zip/corrupt_009.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_009.phpt" + string(%d) "%szip%ccorrupt_009.phpt" ["zip/corrupt_010.phpt"]=> - %unicode|string%(%d) "%szip%ccorrupt_010.phpt" + string(%d) "%szip%ccorrupt_010.phpt" } ===DONE===