diff options
| author | Felipe Pena <felipe@php.net> | 2010-11-07 12:59:22 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2010-11-07 12:59:22 +0000 |
| commit | 50863932a67cffe1855a0ff6451bf5704433f2ff (patch) | |
| tree | 301854ef25c660c3261578f58a1f38250597d049 | |
| parent | 1db7472a73740466b5cd6752e9593d5e5d16a552 (diff) | |
| download | php-git-50863932a67cffe1855a0ff6451bf5704433f2ff.tar.gz | |
- Fixed bug #53248 (rawurlencode RFC 3986 EBCDIC support misses tilde char).
patch by: Justin Martin (frozenfire@php)
| -rw-r--r-- | NEWS | 2 | ||||
| -rw-r--r-- | ext/standard/tests/url/bug53248.phpt | 12 | ||||
| -rw-r--r-- | ext/standard/url.c | 2 |
3 files changed, 15 insertions, 1 deletions
@@ -53,6 +53,8 @@ obtained with ReflectionClass::getProperties(). (Gustavo) - Fixed covariance of return-by-ref constraints. (Etienne) +- Fixed bug #53248 (rawurlencode RFC 3986 EBCDIC support misses tilde char). + (Justin Martin) - Fixed bug #53241 (stream casting that relies on fdopen/fopencookie fails with streams opened with, inter alia, the 'xb' mode). (Gustavo) - Fixed bug #53226 (file_exists fails on big filenames). (Adam) diff --git a/ext/standard/tests/url/bug53248.phpt b/ext/standard/tests/url/bug53248.phpt new file mode 100644 index 0000000000..5e31c510df --- /dev/null +++ b/ext/standard/tests/url/bug53248.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #53248 (rawurlencode RFC 3986 EBCDIC support) +--FILE-- +<?php + +var_dump(rawurlencode('A1_-.~')); +var_dump(rawurldecode('%41%31%5F%2D%2E%7E')); + +?> +--EXPECTF-- +string(6) "A1_-.~" +string(6) "A1_-.~"
\ No newline at end of file diff --git a/ext/standard/url.c b/ext/standard/url.c index b6e01d5513..ae76e8c44a 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -585,7 +585,7 @@ PHPAPI char *php_raw_url_encode(char const *s, int len, int *new_length) str[y++] = hexchars[(unsigned char) s[x] >> 4]; str[y] = hexchars[(unsigned char) s[x] & 15]; #else /*CHARSET_EBCDIC*/ - if (!isalnum(str[y]) && strchr("_-.", str[y]) != NULL) { + if (!isalnum(str[y]) && strchr("_-.~", str[y]) != NULL) { str[y++] = '%'; str[y++] = hexchars[os_toascii[(unsigned char) s[x]] >> 4]; str[y] = hexchars[os_toascii[(unsigned char) s[x]] & 15]; |
