Actions
Bug #2861
closedRegression: PHP URLs return 404 from lighttpd when they contain PATH_INFO ending in a trailing slash.
ASK QUESTIONS IN Forums:
Description
Sometime between 1.4.48 and latest Git master, this bug has been introduced.
http://someserver/index.php/whatever <- works, gets passed along to PHP properly
http://someserver/index.php/whatever/ <- lighttpd returns 404, doesn't get passed along to PHP.
Updated by gstrauss almost 7 years ago
- Category set to core
- Target version changed from 1.4.x to 1.4.49
Thanks for reporting this. Bug would probably be in commit ec9e6abc I will look further later today.
Updated by gstrauss almost 7 years ago
Looks like 'pathinfo' variable was incorrectly overloaded in the code and I need to add back 'found' flag.
Updated by gstrauss almost 7 years ago
--- a/src/response.c +++ b/src/response.c @@ -184,12 +184,14 @@ static handler_t http_response_physical_path_check(server *srv, connection *con) if ('/' != *pathinfo) pathinfo = NULL; } - for (; pathinfo; pathinfo = strchr(pathinfo+1, '/')) { - handler_t rc; - *pathinfo = '\0'; - rc = stat_cache_get_entry(srv, con, con->physical.path, &sce); - *pathinfo = '/'; - if (HANDLER_ERROR == rc) { pathinfo = NULL; break; } + for (char *pprev = pathinfo; pathinfo; pprev = pathinfo, pathinfo = strchr(pathinfo+1, '/')) { + stat_cache_entry *nsce = NULL; + buffer_copy_string_len(srv->tmp_buf, con->physical.path->ptr, pathinfo - con->physical.path->ptr); + if (HANDLER_ERROR == stat_cache_get_entry(srv, con, srv->tmp_buf, &nsce)) { + pathinfo = pathinfo != pprev ? pprev : NULL; + break; + } + sce = nsce; if (!S_ISDIR(sce->st.st_mode)) break; }
Updated by gstrauss almost 7 years ago
- Status changed from Patch Pending to Fixed
- % Done changed from 0 to 100
Applied in changeset 6a6d32698e21a5e4feaf186dcda62350ebf7573d.
Actions
Also available in: Atom