diff options
author | nobody <nobody@zotlabs.com> | 2020-09-30 17:05:36 -0700 |
---|---|---|
committer | nobody <nobody@zotlabs.com> | 2020-09-30 17:05:36 -0700 |
commit | e529635952c9a10f56d3bc90a666eccd9c5b9842 (patch) | |
tree | 65f18d905f5fcd1c2d4174836567c4f534053c67 /include/network.php | |
parent | b878b6902817c7f442281cef30d346bd2a60659f (diff) | |
download | volse-hubzilla-e529635952c9a10f56d3bc90a666eccd9c5b9842.tar.gz volse-hubzilla-e529635952c9a10f56d3bc90a666eccd9c5b9842.tar.bz2 volse-hubzilla-e529635952c9a10f56d3bc90a666eccd9c5b9842.zip |
delete fixes
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/network.php b/include/network.php index d9d534cd7..750d56ac3 100644 --- a/include/network.php +++ b/include/network.php @@ -2061,3 +2061,23 @@ function get_request_string($url) { return '/' . ((count($a) > 3) ? $a[3] : EMPTY_STR); } + + +/* + * + * Takes the output of parse_url and builds a URL from it + * + */ + +function unparse_url($parsed_url) { + $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : ''; + $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; + $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : ''; + $user = isset($parsed_url['user']) ? $parsed_url['user'] : ''; + $pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : ''; + $pass = ($user || $pass) ? "$pass@" : ''; + $path = isset($parsed_url['path']) ? $parsed_url['path'] : ''; + $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : ''; + $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : ''; + return "$scheme$user$pass$host$port$path$query$fragment"; +} |