', ':', '"', '/', '\\', '|', '?', '*'); protected static $reservedDirChars = array('<', '>', ':', '"', '|', '?', '*'); public static function normalize($path) { $filter = new Zend_Filter_RealPath(); $filter->setExists(false); return $filter->filter($path); } /** * Filter special characters in file name * @see http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx * * @param $name * @return mixed */ public static function filterName($name) { return str_replace(self::$reservedChars, '-', $name); } /** * Filter special characters in directory name * @see http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx * * @param $name * @return mixed */ public static function filterDirName($name) { return str_replace(self::$reservedDirChars, '-', $name); } }