mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 18:14:44 +02:00
fix(FeedExpander): if parse fails, include offending url in exception message (#3938)
Also some refactors
This commit is contained in:
parent
b2c8475b2c
commit
d01c462ad5
5 changed files with 56 additions and 41 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue