realpath() without resolving symlinks?
I already read about realpath() , but is there a function that I can pass a base directory and a filename that would give me the following result without resolving symlinks or checking whether files actually exist? Or do I have to use a modified realpath() ? "/var/", "../etc///././/passwd" => "/etc/passwd" Here is a normalize_path() function: If the given path is relative, the function starts by prepending the current working directory to it. Then the special path components like .. , . or empty components are treated, and the result is returned. For .. , the last component is removed if there