mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-06-27 07:29:07 +02:00
fix: dont fail for non-existing enabled bridge (#3589)
* fix: dont fail for non-existing enabled bridge * yup
This commit is contained in:
parent
10f7b6f4f6
commit
ed97ce8646
4 changed files with 25 additions and 12 deletions
|
@ -23,7 +23,12 @@ final class BridgeFactory
|
|||
$this->enabledBridges = $this->bridgeClassNames;
|
||||
break;
|
||||
}
|
||||
$this->enabledBridges[] = $this->createBridgeClassName($enabledBridge);
|
||||
$bridgeClassName = $this->createBridgeClassName($enabledBridge);
|
||||
if ($bridgeClassName) {
|
||||
$this->enabledBridges[] = $bridgeClassName;
|
||||
} else {
|
||||
Logger::info(sprintf('Bridge not found: %s', $enabledBridge));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,13 +47,10 @@ final class BridgeFactory
|
|||
$name = self::normalizeBridgeName($bridgeName);
|
||||
$namesLoweredCase = array_map('strtolower', $this->bridgeClassNames);
|
||||
$nameLoweredCase = strtolower($name);
|
||||
|
||||
if (! in_array($nameLoweredCase, $namesLoweredCase)) {
|
||||
throw new \Exception(sprintf('Bridge name invalid: %s', $bridgeName));
|
||||
return null;
|
||||
}
|
||||
|
||||
$index = array_search($nameLoweredCase, $namesLoweredCase);
|
||||
|
||||
return $this->bridgeClassNames[$index];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue