Mercurial > urweb
diff src/c/request.c @ 1169:420e38516dc2
Normalize URLs to deal with page names that contain apostrophes
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 25 Feb 2010 15:08:52 -0500 |
parents | e6eabf0c5ccc |
children | 236dc296c32d |
line wrap: on
line diff
--- a/src/c/request.c Thu Feb 25 14:55:35 2010 -0500 +++ b/src/c/request.c Thu Feb 25 15:08:52 2010 -0500 @@ -128,6 +128,14 @@ size_t boundary_len = 0; char *inputs; const char *prefix = uw_get_url_prefix(ctx); + char *s; + + for (s = path; *s; ++s) { + if (s[0] == '%' && s[1] == '2' && s[2] == '7') { + s[0] = '\''; + memmove(s+1, s+3, strlen(s+3)+1); + } + } uw_set_currentUrl(ctx, path);