url = trim($request_input); $data = parse_url($this->url); foreach ($data as $key => $value) { $this->{$key} = urldecode((string) $value); } // If scheme is missing, infer as default scheme if (!$this->scheme) { $this->scheme = Server::SCHEME; } } /** * Get a new URL with some text appended to the path * * @return string New URL */ public function getUrlAppendPath(string $text): string { return $this->scheme . '://' . ($this->user ? $this->user : '') . ($this->pass ? ':' . $this->pass : '') . ($this->user ? '@' : '') . $this->host . ($this->port ? ':' . $this->port : '') . $this->path . $text . ($this->query ? '?' . $this->query : '') . ($this->fragment ? '#' . $this->fragment : ''); } }