On Thu, Feb 7, 2008 at 4:29 PM, Lloyd Parkes <Lloyd.Parkes@xxxxxxxxxxx> wrote: > solprovider@xxxxxxxxxx wrote: > > Input validation is typically handled with something like: > > if(ServerRoot ends with slash) ServerRoot = ServerRootWithFinalSlashRemoved; > I must confess that I thought this was the normal way to do things as well. > > Of course, one problem is that removing a trailing slash may not be the right > thing to do because Apache runs on more than just Unix. Windows is probably easy > to handle compared with NetWare and mainframes. > Lloyd Parkes The directory separator depends on the OS: slash (*nix and others), backslash (MS), and colon (Apple). The period was used by at least one OS. Most programming languages have a method for discovering the proper separator e.g. File.separator in Java. The difficulty is not discovering the separator character, but handling multibyte characters. The final byte may match the separator while part of a multibyte character so removing that byte would not be correct. My designs prefer input validation over instructions like your objection. I often add code to verify results from my own functions under the assumption that I or someone else may break things someday. My research on how httpd handles this will be delayed until next week. I am still hoping an httpd dev will comment. solprovider --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx