From: Steph Fox Date: Tue, 13 May 2008 14:11:24 +0000 (+0000) Subject: - Allow broken.dirnames to use phar too X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~227 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d169ebcfc681b1c68850787d3107bdcfc2b340d;p=php - Allow broken.dirnames to use phar too - Add test - Kill MSVC compiler warning --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index ab2cb08ac4..4e14d2bbb6 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, keylen) && (filename_len == keylen + if (!memcmp(filename, key, 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===