From ce586bf82672c45be6789d640d65a8d9ed416515 Mon Sep 17 00:00:00 2001 From: Steph Fox Date: Tue, 13 May 2008 18:43:18 +0000 Subject: [PATCH] - MF53 dotted.path support --- ext/phar/phar.c | 5 +--- ext/phar/tests/phar_dotted_path.phpt | 40 ++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 ext/phar/tests/phar_dotted_path.phpt diff --git a/ext/phar/phar.c b/ext/phar/phar.c index dc0ec17960..50a8d60026 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1606,7 +1606,7 @@ woohoo: zend_hash_move_forward(&(PHAR_GLOBALS->phar_fname_map)); continue; } - if (!memcmp(filename, key.s, keylen) && (filename_len == keylen + if (!memcmp(filename, key.s, keylen) && ((uint)filename_len == keylen || filename[keylen] == '/' || filename[keylen] == '\0')) { if (FAILURE == zend_hash_get_current_data(&(PHAR_GLOBALS->phar_fname_map), (void **) &pphar)) { break; @@ -1653,9 +1653,6 @@ next_extension: return SUCCESS; case FAILURE : /* look for more extensions */ - if (is_complete) { - return FAILURE; - } pos = strchr(pos + 1, '.'); if (pos) { *ext_str = NULL; diff --git a/ext/phar/tests/phar_dotted_path.phpt b/ext/phar/tests/phar_dotted_path.phpt new file mode 100644 index 0000000000..823196fcce --- /dev/null +++ b/ext/phar/tests/phar_dotted_path.phpt @@ -0,0 +1,40 @@ +--TEST-- +Phar: create new Phar with broken.dirname in path +--SKIPIF-- + +--INI-- +phar.readonly=0 +phar.require_hash=0 +--FILE-- + +===DONE=== +--CLEAN-- + +--EXPECT-- +this is a +this is b +===DONE=== -- 2.40.0