1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-12 11:34:09 +02:00

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
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;