CraftCli\Handlebars\Loader\FilesystemLoader::normalizeRelativePath PHP Method

normalizeRelativePath() protected method

From https://github.com/thephpleague/flysystem/blob/master/src/Util.php
protected normalizeRelativePath ( string $path ) : string
$path string
return string
    protected function normalizeRelativePath($path)
    {
        // Path remove self referring paths ("/./").
        $path = preg_replace('#/\\.(?=/)|^\\./|/\\./?$#', '', $path);
        // Regex for resolving relative paths
        $regex = '#/*[^/\\.]+/\\.\\.#Uu';
        while (preg_match($regex, $path)) {
            $path = preg_replace($regex, '', $path);
        }
        return $path;
    }