src/includes/classes/Core/Utils/UrlParse.php
public function un(array $parts): string
    {
        $scheme   = '';
        $host     = $port     = '';
        $user     = $pass     = '';
        $path     = $query     = $fragment = '';

        $parts = array_map('strval', $parts);

        if (isset($parts['scheme'][0])) {
            if ($parts['scheme'] === '//') {
                $scheme = $parts['scheme'];
            } else {
                $scheme = $parts['scheme'].'://';
            }
        } // Supports cross-protocol scheme.

        if (isset($parts['host'][0])) {
            $host = $parts['host'];
        }
        if (isset($parts['port'][0])) {
            $port = ':'.$parts['port'];
        }
        if (isset($parts['user'][0])) {
            $user = $parts['user'];
        }
        if (isset($parts['pass'][0])) {
            $pass = ':'.$parts['pass'];
        }
        if (isset($user[0]) || isset($pass[0])) {
            $pass .= '@'; // `user@`, `:pass@`, or `user:pass@`.
        }
        if (isset($parts['path'][0])) {
            $path = '/'.$this->c::mbLTrim($parts['path'], '/');
        }
        if (isset($parts['query'][0])) {
            $query = '?'.$parts['query'];
        }
        if (isset($parts['fragment'][0])) {
            $fragment = '#'.$parts['fragment'];
        }
        return $scheme.$user.$pass.$host.$port.$path.$query.$fragment;
    }
public function un(array $parts): string
    {
        $scheme   = '';
        $host     = $port     = '';
        $user     = $pass     = '';
        $path     = $query     = $fragment = '';

        $parts = array_map('strval', $parts);

        if (isset($parts['scheme'][0])) {
            if ($parts['scheme'] === '//') {
                $scheme = $parts['scheme'];
            } else {
                $scheme = $parts['scheme'].'://';
            }
        } // Supports cross-protocol scheme.

        if (isset($parts['host'][0])) {
            $host = $parts['host'];
        }
        if (isset($parts['port'][0])) {
            $port = ':'.$parts['port'];
        }
        if (isset($parts['user'][0])) {
            $user = $parts['user'];
        }
        if (isset($parts['pass'][0])) {
            $pass = ':'.$parts['pass'];
        }
        if (isset($user[0]) || isset($pass[0])) {
            $pass .= '@'; // `user@`, `:pass@`, or `user:pass@`.
        }
        if (isset($parts['path'][0])) {
            $path = '/'.$this->c::mbLTrim($parts['path'], '/');
        }
        if (isset($parts['query'][0])) {
            $query = '?'.$parts['query'];
        }
        if (isset($parts['fragment'][0])) {
            $fragment = '#'.$parts['fragment'];
        }
        return $scheme.$user.$pass.$host.$port.$path.$query.$fragment;
    }
Unparses a URL.

@since 150424 Initial release.

@param array $parts Input URL parts.

@return string Unparsed URL in string format.