/** * {@inheritdoc} */ protected function cleanUrl($url) { if ($url instanceof Url) { $url = $url->setAbsolute()->toString(); } // Strip the base URL from the beginning for absolute URLs. if ($this->baseUrl !== '' && strpos($url, $this->baseUrl) === 0) { $url = substr($url, strlen($this->baseUrl)); } // Make sure there is a forward slash at the beginning of relative URLs for // consistency. if (parse_url($url, PHP_URL_HOST) === NULL && strpos($url, '/') !== 0) { $url = "/{$url}"; } return parent::cleanUrl($url); }