From: Alex Young Date: 2006-06-06T00:22:58+09:00 Subject: Re: New webserver Stuart Brand wrote: > Thanks all, this worked fine > > def self.path(path) > fileLine = path[1].strip > fileLine = fileLine.gsub(/\.\//, '') > fileLine = fileLine.gsub(/\/\./, '') > fileLine = fileLine.gsub(/\\/, '') > fileLine = fileLine.gsub(/\.{2,}/, '') > fileLine = fileLine.gsub(/\/{2,}/, '') > fileLine = "/srv/www/htdocs/" + fileLine > return fileLine > end > > Is there a way of making it look prettier? > > I'm trying to stop people using the address bar to access parts of the > system the should not In addition to what others have said, have a look at File.expand_path. -- Alex