Revision 2308 trunk

src/mod_userdir.c (revision 2308)
257 257
				return HANDLER_GO_ON;
258 258
			}
259 259
		}
260
		if (con->conf.force_lowercase_filenames) {
261
			buffer_to_lower(p->username);
262
		}
260 263

  
261 264
		buffer_copy_string_buffer(p->temp_path, p->conf.basepath);
262 265
		PATHNAME_APPEND_SLASH(p->temp_path);
......
279 282
		}
280 283
	}
281 284

  
285
	/* the physical rel_path is basically the same as uri.path;
286
	 * but it is converted to lowercase in case of force_lowercase_filenames and some special handling
287
	 * for trailing '.', ' ' and '/' on windows
288
	 * we assume that no docroot/physical handler changed this
289
	 * (docroot should only set the docroot/server name, phyiscal should only change the phyiscal.path;
290
	 *  the exception mod_secure_download doesn't work with userdir anyway)
291
	 */
282 292
	PATHNAME_APPEND_SLASH(p->temp_path);
283
	buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
293
	/* if no second '/' is found, we assume that it was stripped from the uri.path for the special handling
294
	 * on windows.
295
	 * we do not care about the trailing slash here on windows, as we already ensured it is a directory
296
	 *
297
	 * TODO: what to do with trailing dots in usernames on windows? they may result in the same directory
298
	 *       as a username without them.
299
	 */
300
	if (NULL != (rel_url = strchr(con->physical.rel_path->ptr + 2, '/'))) {
301
		buffer_append_string(p->temp_path, rel_url + 1); /* skip the / */
302
	}
284 303
	buffer_copy_string_buffer(con->physical.path, p->temp_path);
285 304

  
286 305
	buffer_reset(p->temp_path);
NEWS (revision 2308)
57 57
  * Match headers case insensitive in response (removing of X-{Sendfile,LIGHTTPD-*}, catching Date/Server)
58 58
  * fixed mem leak in ssi expression parser (#1753), thx Take5k
59 59
  * decode url before matching in mod_rewrite (#1720)
60
  * fixed bug with case-insensitive filenames in mod_userdir (#1589), spotted by "anders1"
60 61

  
61 62
- 1.5.0-r19.. -
62 63
  * -F option added for spawn-fcgi
63 64

  

Also available in: Unified diff