httpClient->isPrivateURL($this->url)) { $this->logger->info('Blocked attempt to fetch URL from private network: '.$this->url); return $this->url; } // Do not follow redirects to prevent SSRF bypasses through redirect chains. $html = $this->httpClient->get($this->url, [], false, false); if (preg_match('/(.*)<\/title>/siU', $html, $matches)) { return trim($matches[1]); } $components = parse_url($this->url); if (! empty($components['host']) && ! empty($components['path'])) { return $components['host'].$components['path']; } return $this->url; } }