fix(FeedExpander): if parse fails, include offending url in exception message (#3938)

Also some refactors
This commit is contained in:
Dag 2024-01-29 21:51:34 +01:00 committed by GitHub
parent b2c8475b2c
commit d01c462ad5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 56 additions and 41 deletions

View file

@ -102,12 +102,17 @@ class BMDSystemhausBlogBridge extends BridgeAbstract
//-----------------------------------------------------
public function detectParameters($url)
{
$parsed_url = parse_url($url);
if ($parsed_url['host'] != 'www.bmd.com') {
try {
$parsedUrl = Url::fromString($url);
} catch (UrlException $e) {
return null;
}
$path = explode('/', $parsed_url['path']);
if ($parsedUrl->getHost() != 'www.bmd.com') {
return null;
}
$path = explode('/', $parsedUrl->getPath());
if ($this->getURIbyCountry($path[1]) == '') {
return null;