From: Arnaud Le Blanc Date: Sat, 2 Aug 2008 06:37:34 +0000 (+0000) Subject: MFB: Allow urlencode()d filer names in php://filter (fixes #43008) X-Git-Tag: BEFORE_HEAD_NS_CHANGE~907 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=630fb69796bfd38f518983ac4a14a9ef85d52e8b;p=php MFB: Allow urlencode()d filer names in php://filter (fixes #43008) --- diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 60c853b118..b60599d10a 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -142,6 +142,7 @@ static void php_stream_apply_filter_list(php_stream *stream, char *filterlist, i p = php_strtok_r(filterlist, "|", &token); while (p) { + php_url_decode(p, strlen(p)); if (read_chain) { if ((temp_filter = php_stream_filter_create(p, NULL, php_stream_is_persistent(stream) TSRMLS_CC))) { php_stream_filter_append(&stream->readfilters, temp_filter); diff --git a/ext/standard/tests/file/bug43008.phpt b/ext/standard/tests/file/bug43008.phpt new file mode 100644 index 0000000000..5e11cfcbe9 --- /dev/null +++ b/ext/standard/tests/file/bug43008.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #43008 (php://filter uris ignore url encoded filternames and can't handle slashes) +--FILE-- + +--EXPECTF-- +string(8) "foob%E2r"