/**
* Makes path name safe to use.
*
* @param string $path The full path to sanitise.
*
* @return string The sanitised string.
*
* @since 1.7.0
*/
public static function makeSafe($path)
{
$regex = array('#[^A-Za-z0-9_\\\\/\\(\\)\\[\\]\\{\\}\\#\\$\\^\\+\\.\'~`!@&=;,-]#');
return preg_replace($regex, '', $path);
}