code/libraries/joomlatools/library/template/locator/abstract.php
public function realPath($file)
    {
        $result = false;
        $path   = dirname($file);

        // Is the path based on a stream?
        if (strpos($path, '://') === false)
        {
            // Not a stream, so do a realpath() to avoid directory traversal attempts on the local file system.
            $path = realpath($path); // needed for substr() later
            $file = realpath($file);
        }

        // The substr() check added to make sure that the realpath() results in a directory registered so that
        // non-registered directories are not accessible via directory traversal attempts.
        if (file_exists($file) && substr($file, 0, strlen($path)) == $path) {
            $result = $file;
        }

        return $result;
    }
public function realPath($file)
    {
        $result = false;
        $path   = dirname($file);

        // Is the path based on a stream?
        if (strpos($path, '://') === false)
        {
            // Not a stream, so do a realpath() to avoid directory traversal attempts on the local file system.
            $path = realpath($path); // needed for substr() later
            $file = realpath($file);
        }

        // The substr() check added to make sure that the realpath() results in a directory registered so that
        // non-registered directories are not accessible via directory traversal attempts.
        if (file_exists($file) && substr($file, 0, strlen($path)) == $path) {
            $result = $file;
        }

        return $result;
    }
public function realPath ( $ file ) { $ result = false ; $ path = dirname ( $ file ) ; // Is the path based on a stream? if ( strpos ( $ path , '://' ) === false ) { // Not a stream, so do a realpath() to avoid directory traversal attempts on the local file system. $ path = realpath ( $ path ) ; // needed for substr() later $ file = realpath ( $ file ) ; } // The substr() check added to make sure that the realpath() results in a directory registered so that // non-registered directories are not accessible via directory traversal attempts. if ( file_exists ( $ file ) && substr ( $ file , 0 , strlen ( $ path ) ) == $ path ) { $ result = $ file ; } return $ result ; }
Get a path from an file

Function will check if the path is an alias and return the real file path

@param  string $file The file path
@return string The real file path
Get a path from an file