I'm trying to figure out exactly how files are renamed when you upload them into an Image Gallery album. Spaces are replaced with hyphens, multiple hyphens are cleaned up, underscores are (sometimes) removed, and punctuation is removed. There might be other stuff going on too, but I'm not sure because I haven't been able to track down the exact functions responsible.
I need to be able to associate the original file name with the one that SilverStripe created on upload, so I really need to know exactly what's going on. Anybody have any ideas where to look? I thought I might have found it in sapphire/filesystem/File.php, function setName($name), but after trying it on some sample input, it seems that's not quite it.