Mercurial > urweb
changeset 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 | 69f1d39d3f2d |
children | 52c6ac6a59f1 |
files | src/c/request.c |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
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);