From bd58266b80d9ae26aac64312c41ef5b892ed06e6 Mon Sep 17 00:00:00 2001 From: Dag Date: Tue, 23 Jan 2024 22:05:03 +0100 Subject: [PATCH] fix(OLX): deprecation notice (#3915) --- bridges/OLXBridge.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bridges/OLXBridge.php b/bridges/OLXBridge.php index 2fc19641..1a8be901 100644 --- a/bridges/OLXBridge.php +++ b/bridges/OLXBridge.php @@ -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)) {