Apr 13

File Path Cleaner Function (clnFile)

Prevents traversing of a directory tree by using “..” to move above the allowed path.

function clnFile(input)
	filTemp = input
	do while instr(filTemp,"..")
		filTemp = replace(filTemp,"..","")
	clnFile = filTemp
end function

Permanent link to this article: https://www.wperry.net/code/clnfile/

Leave a Reply

Your email address will not be published.