Restore the ability to whitelist all the bridges by putting a wildcard into the whitelist file.
This commit is contained in:
parent
2dda74dfe7
commit
1763a1518c
1 changed files with 14 additions and 8 deletions
22
index.php
22
index.php
|
@ -93,20 +93,26 @@ $whitelist_default = array(
|
||||||
"WikipediaBridge",
|
"WikipediaBridge",
|
||||||
"YoutubeBridge");
|
"YoutubeBridge");
|
||||||
|
|
||||||
if(!file_exists($whitelist_file)){
|
|
||||||
$whitelist_selection = $whitelist_default;
|
|
||||||
$whitelist_write = implode("\n", $whitelist_default);
|
|
||||||
file_put_contents($whitelist_file, $whitelist_write);
|
|
||||||
} else {
|
|
||||||
$whitelist_selection = explode("\n", file_get_contents($whitelist_file));
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Bridge::setDir(__DIR__ . '/bridges/');
|
Bridge::setDir(__DIR__ . '/bridges/');
|
||||||
Format::setDir(__DIR__ . '/formats/');
|
Format::setDir(__DIR__ . '/formats/');
|
||||||
Cache::setDir(__DIR__ . '/caches/');
|
Cache::setDir(__DIR__ . '/caches/');
|
||||||
|
|
||||||
|
if(!file_exists($whitelist_file)){
|
||||||
|
$whitelist_selection = $whitelist_default;
|
||||||
|
$whitelist_write = implode("\n", $whitelist_default);
|
||||||
|
file_put_contents($whitelist_file, $whitelist_write);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$whitelist_file_content = file_get_contents($whitelist_file);
|
||||||
|
if($whitelist_file_content != "*\n") {
|
||||||
|
$whitelist_selection = explode("\n", $whitelist_file_content);
|
||||||
|
} else {
|
||||||
|
$whitelist_selection = Bridge::listBridges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$action = filter_input(INPUT_GET, 'action');
|
$action = filter_input(INPUT_GET, 'action');
|
||||||
$bridge = filter_input(INPUT_GET, 'bridge');
|
$bridge = filter_input(INPUT_GET, 'bridge');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue