fix(OLX): deprecation notice (#3915)

This commit is contained in:
Dag 2024-01-23 22:05:03 +01:00 committed by GitHub
parent 4973aaadf6
commit bd58266b80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,7 +56,13 @@ EOF;
public function getName()
{
$paths = explode('/', parse_url($this->getInput('url'), PHP_URL_PATH));
$url = $this->getInput('url');
if (!$url) {
return parent::getName();
}
$parsedUrl = Url::fromString($url);
$paths = explode('/', $parsedUrl->getPath());
$query = array_reduce($paths, function ($q, $p) {
if (preg_match('/^q-(.+)$/i', $p, $matches)) {