diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 96376a3f4ac..b4c6e9f0458 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -941,19 +941,7 @@ PHP_METHOD(Phar, webPhar) ++ext; #if PHP_MAJOR_VERSION >= 6 - if (FAILURE == zend_hash_find(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val)) { - /* try unicode extension */ - zstr zext; - zspprintf(IS_UNICODE, &zext, 0, "%s", ext); - if (SUCCESS == zend_u_hash_find(Z_ARRVAL_P(mimeoverride), IS_UNICODE, zext, strlen(ext)+1, (void **) &val)) { - ezfree(zext); - goto unicode_found; - } - ezfree(zext); - goto notfound; - } -unicode_found: - { /* this prevents parse error */ + if (phar_find_key(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val)) { #else if (SUCCESS == zend_hash_find(Z_ARRVAL_P(mimeoverride), ext, strlen(ext)+1, (void **) &val)) { #endif @@ -990,9 +978,6 @@ unicode_found: } } -#if PHP_MAJOR_VERSION >= 6 -notfound: -#endif if (!mime_type) { code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type TSRMLS_CC); } diff --git a/ext/phar/tests/cache_list/copyonwrite17.phar.phpt b/ext/phar/tests/cache_list/copyonwrite17.phar.phpt index 6e13088512e..158c049b147 100644 --- a/ext/phar/tests/cache_list/copyonwrite17.phar.phpt +++ b/ext/phar/tests/cache_list/copyonwrite17.phar.phpt @@ -10,5 +10,5 @@ phar.readonly=0 files/write17.phar --EXPECTF-- NULL -string(2) "hi" +%string|unicode%(2) "hi" ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/copyonwrite19.phar.phpt b/ext/phar/tests/cache_list/copyonwrite19.phar.phpt index 4870550c4d0..6e03554d96c 100644 --- a/ext/phar/tests/cache_list/copyonwrite19.phar.phpt +++ b/ext/phar/tests/cache_list/copyonwrite19.phar.phpt @@ -10,5 +10,5 @@ phar.readonly=0 files/write19.phar --EXPECTF-- string(2) "hi" -string(3) "hi2" +%string|unicode%(3) "hi2" ok \ No newline at end of file diff --git a/ext/phar/tests/cache_list/files/frontcontroller12.phar b/ext/phar/tests/cache_list/files/frontcontroller12.phar index 9e455876101..1cf36292820 100644 Binary files a/ext/phar/tests/cache_list/files/frontcontroller12.phar and b/ext/phar/tests/cache_list/files/frontcontroller12.phar differ diff --git a/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc index ba17df37e17..f1e4645e2f0 100644 --- a/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc +++ b/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc @@ -3,13 +3,13 @@ $a = new Phar(dirname(__FILE__) . '/frontcontroller12.phar'); $a['index.php'] = 'setStub('setStub('setStub(' "a.phps"); + static $b = array(b"/hi" => "a.phps"); if (isset($b[$a])) return $b[$a]; return $a; } diff --git a/ext/phar/tests/cache_list/files/frontcontroller4.phar b/ext/phar/tests/cache_list/files/frontcontroller4.phar index 4c9a92a197b..83594618104 100644 Binary files a/ext/phar/tests/cache_list/files/frontcontroller4.phar and b/ext/phar/tests/cache_list/files/frontcontroller4.phar differ diff --git a/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc index 5c6a43f9546..daf807e419c 100644 --- a/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc +++ b/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc @@ -7,7 +7,7 @@ $a['a.phps'] = 'setStub(' false); + static $b = array(b"/hi" => false); if (isset($b[$a])) return $b[$a]; return $a; } diff --git a/ext/phar/tests/cache_list/files/frontcontroller8.phar b/ext/phar/tests/cache_list/files/frontcontroller8.phar index ec05ceafb0c..c9c0e409ec4 100644 Binary files a/ext/phar/tests/cache_list/files/frontcontroller8.phar and b/ext/phar/tests/cache_list/files/frontcontroller8.phar differ diff --git a/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc index 1dfb654a031..8629f0890d2 100644 --- a/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc +++ b/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc @@ -2,7 +2,7 @@ @unlink(dirname(__FILE__) . '/frontcontroller8.phar'); $a = new Phar(dirname(__FILE__) . '/frontcontroller8.phar'); $a['a.phps'] = 'hio1'; -$a['a1.phps'] = 'setStub('