mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-02 17:14:38 +02:00
core: Refactor bridge whitelisting
- Move all whitelisting functionality inside Bridge.php - Set default whitelist once in index.php using Bridge::setWhitelist() - Include bridge sanitizing inside Bridge.php Bridge::sanitizeBridgeName($name) Bridge.php now maintains the whitelist internally.
This commit is contained in:
parent
a0490e3673
commit
e26d61ec0a
3 changed files with 89 additions and 34 deletions
|
@ -22,7 +22,7 @@ final class BridgeList {
|
|||
EOD;
|
||||
}
|
||||
|
||||
private static function getBridges($whitelist, $showInactive, &$totalBridges, &$totalActiveBridges) {
|
||||
private static function getBridges($showInactive, &$totalBridges, &$totalActiveBridges) {
|
||||
|
||||
$body = '';
|
||||
$totalActiveBridges = 0;
|
||||
|
@ -35,7 +35,7 @@ EOD;
|
|||
|
||||
foreach($bridgeList as $bridgeName) {
|
||||
|
||||
if(Bridge::isWhitelisted($whitelist, strtolower($bridgeName))) {
|
||||
if(Bridge::isWhitelisted($bridgeName)) {
|
||||
|
||||
$body .= BridgeCard::displayBridgeCard($bridgeName, $formats);
|
||||
$totalActiveBridges++;
|
||||
|
@ -131,7 +131,7 @@ EOD;
|
|||
EOD;
|
||||
}
|
||||
|
||||
static function create($whitelist, $showInactive = true) {
|
||||
static function create($showInactive = true) {
|
||||
|
||||
$totalBridges = 0;
|
||||
$totalActiveBridges = 0;
|
||||
|
@ -141,7 +141,7 @@ EOD;
|
|||
. '<body onload="search()">'
|
||||
. BridgeList::getHeader()
|
||||
. BridgeList::getSearchbar()
|
||||
. BridgeList::getBridges($whitelist, $showInactive, $totalBridges, $totalActiveBridges)
|
||||
. BridgeList::getBridges($showInactive, $totalBridges, $totalActiveBridges)
|
||||
. BridgeList::getFooter($totalBridges, $totalActiveBridges, $showInactive)
|
||||
. '</body></html>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue