[Bridge] Fix broken bridge initialization

Commit e26d61e introduced a bug that causes the error message "The
bridge you [sic!] looking for does not exist." if the bridge name
specified in the query ends on "Bridge"
(i.e. '&bridge=SoundcloudBridge'), while other queries work fine
(i.e. '&bridge=Soundcloud').

This commit fixes that issue by sanitizing the bridge name before
creating the class.

References #922
This commit is contained in:
logmanoriginal 2018-11-13 17:36:03 +01:00
parent dd95ec6200
commit 007ee4d858

View file

@ -28,7 +28,7 @@ EOD;
throw new \InvalidArgumentException($message); throw new \InvalidArgumentException($message);
} }
$nameBridge = $nameBridge . 'Bridge'; $nameBridge = Bridge::sanitizeBridgeName($nameBridge) . 'Bridge';
$pathBridge = self::getDir() . $nameBridge . '.php'; $pathBridge = self::getDir() . $nameBridge . '.php';
if(!file_exists($pathBridge)) { if(!file_exists($pathBridge)) {