Psr7Middlewares\Utils\Helpers::fixPath PHP Method

fixPath() public static method

./' in a path.
public static fixPath ( string $path ) : string
$path string Path to resolve
return string
    public static function fixPath($path)
    {
        $path = str_replace('\\', '/', $path);
        //windows paths
        $replace = ['#(/\\.?/)#', '#/(?!\\.\\.)[^/]+/\\.\\./#'];
        do {
            $path = preg_replace($replace, '/', $path, -1, $n);
        } while ($n > 0);
        return $path;
    }