]> granicus.if.org Git - php/commitdiff
- MFH: Make iconv filter accept '.' as the delimiter between encoding names as
authorMoriyoshi Koizumi <moriyoshi@php.net>
Tue, 17 Mar 2009 05:31:04 +0000 (05:31 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Tue, 17 Mar 2009 05:31:04 +0000 (05:31 +0000)
  well as '/'. It's impossible to specify the filter in php://filter without
  this fix.

# I hope this to be merged to 5.2 as well. This doesn't break BC as there is
# no such encoding name that contains '.'. (Andif there were to be such one,
# the filter is failed in the first place since it also uses '.' for the
# delimiter between the filter name and the "from" encoding name.

ext/iconv/iconv.c

index 6fb0c9a4f6e1c70dea0f96e0a3991a4ef5b27f31..c3b392c6f4750b52ded14f0e66113327bf0b9133 100644 (file)
@@ -2759,7 +2759,7 @@ static php_stream_filter *php_iconv_stream_filter_factory_create(const char *nam
                return NULL;
        }
        ++from_charset;
-       if ((to_charset = strchr(from_charset, '/')) == NULL) {
+       if ((to_charset = strpbrk(from_charset, "/.")) == NULL) {
                return NULL;
        }
        from_charset_len = to_charset - from_charset;