summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/tests/url/bug53248.phpt12
-rw-r--r--ext/standard/url.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/ext/standard/tests/url/bug53248.phpt b/ext/standard/tests/url/bug53248.phpt
new file mode 100644
index 0000000..5e31c51
--- /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 dd99cb5..ae91350 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];