src/Viserio/Component/Routing/Generator/UrlGenerator.php
protected function replacePathSegments(string $path): string
    {
        $path = \strtr($path, ['/../' => '/%2E%2E/', '/./' => '/%2E/']);

        if ('/..' === \substr($path, -3)) {
            $path = \substr($path, 0, -2) . '%2E%2E';
        } elseif ('/.' === \substr($path, -2)) {
            $path = \substr($path, 0, -1) . '%2E';
        }

        return $path;
    }
protected function replacePathSegments(string $path): string
    {
        $path = \strtr($path, ['/../' => '/%2E%2E/', '/./' => '/%2E/']);

        if ('/..' === \substr($path, -3)) {
            $path = \substr($path, 0, -2) . '%2E%2E';
        } elseif ('/.' === \substr($path, -2)) {
            $path = \substr($path, 0, -1) . '%2E';
        }

        return $path;
    }
The path segments "." and ".." are interpreted as relative reference when resolving a URI;
see http://tools.ietf.org/html/rfc3986#section-3.3 so we need to encode them as they are not used for this purpose here
otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route.

@param string $path

@return string