go to bug id or search bugs for
because filternames can contain slashes (convert.iconv.from-enc/to-enc) it should be possible to pass URL-encodet filternames to php://filter
$str = 'php://filter/read=convert.iconv.ISO-8859-15%2FUTF-8/resource=data://text/plain,foobar';
^ url encoded slash
Warning: file_get_contents(): unable to create or locate filter "convert.iconv.ISO-8859-15%2FUTF-8" in /var/www/foo/a.php on line 34
Warning: file_get_contents(): Unable to create filter (convert.iconv.ISO-8859-15%2FUTF-8) in /var/www/foo/a.php on line 34
Add a Patch
Add a Pull Request
If the filtername is not URL encoded than i get this:
Warning: readfile(): unable to create or locate filter "convert.iconv.ISO-8859-15" in ...
Warning: readfile(): Unable to create filter (convert.iconv.ISO-8859-15) in ...
Warning: readfile(): unable to locate filter "UTF-8" in ...
Warning: readfile(): Unable to create filter (UTF-8) in ...
And this should work because..? (IMO, it's expected, you pass invalid data -> you get an error..simple.)
This should work because otherwise there is no way to pass valid and existing filternames as URIs to PHP.
(This bug is approved by hartmut btw.)
A possible fix would be to urldecode() filter names in the php:// wrapper before passing them to the filter API:
The patch works perfectly for me.
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.