Sanitizes a filename, replacing spaces with dashes.

Removes special characters that are illegal in filenames on certain
operating systems and special characters requiring special escaping
to manipulate at the command line. Replaces spaces and consecutive
dashes with a single dash. Trim period, dash and underscore from beginning
and end of filename.

@param string $filename

@return string       The sanitized filename