From: poy <po...@12...> - 2007-11-15 15:10:44
|
yep. i can imagine 3 functions instead of 1 currently: - cleanBadChars(string tmp) would clean any occurence of badChars[] = found in tmp. - validatePath would be the current validateFileName, making use of = cleanBadChars in its first part. - a new validateFileName would handle filename sanitisation, making use = of cleanBadChars and then cleaning the remaining '\\' if win32 or '/' = otherwise. poy Indeed; as itinerants has suggested, splitting it up would be a good = idea. It seems to me like there are two things going on here: a.. Filename sanitisation (remove invalid characters).=20 b.. Path sanitisation (remove unnecessary parts of paths). The URL -> filename case (e.g. for hub URLs) should be handled with = the filename sanitisation, provided that all the path separators are = included (I think including "\" and "/" in all cases would be good). = Other places would need to be checked. If no-one's done it before I get back home (Friday night), I'll = probably have a bash at doing a patch for this. --=20 James Ross -------------------------------------------------------------------------= ----- = -------------------------------------------------------------------------= This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a = browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ -------------------------------------------------------------------------= ----- _______________________________________________ dcplusplus-devel mailing list dcp...@li... https://lists.sourceforge.net/lists/listinfo/dcplusplus-devel |