/** * Clean up filename. * * @param string Initial filename * @return string Normalized filename */ private function cleanFilename($name) { $name = Strings::replaceSpecialChars($name); // first char is dot or if all chars were stripped out by replaceSpecialChars() if ($name[0] == '.' || strlen($name) == 0) { $name = "upload".$name; } return $name; }