public static function sanitize_filename($i, $allow_subdirs = false, $allowabsolute = false) {
		$i = trim($i);
		$replacements = ['../', './'];
		if ($allow_subdirs === false) {
			$replacements[] = '/';
		}
		if ($allowabsolute !== true && $i{0} === '/') {
			$i = substr($i, 1);
		}
		return str_replace($replacements, '', $i);
	}