whitelist: Do case-insensitive whitelist matching

Matching whitelisted bridges using a case-insensitive match makes
sense for following reasons:

- Wrong upper/lower case spelling in the whitelist is not easily
discovered. Example: Misspelling 'Youtube' as 'YouTube' will not
show the 'Youtube' bridge (while it is expected to show)

- Two bridges with the same name but different letter casing are
discouraged to prevent confusion and keep the project compatible
with Windows machines
This commit is contained in:
logmanoriginal 2017-08-05 23:30:24 +02:00
parent fc0ae42450
commit 84d2c02a09
2 changed files with 7 additions and 4 deletions

View file

@ -94,8 +94,8 @@ EOD;
static public function isWhitelisted($whitelist, $name){
if(in_array($name, $whitelist)
|| in_array($name . '.php', $whitelist)
|| in_array($name . 'Bridge', $whitelist) // DEPRECATED
|| in_array($name . 'Bridge.php', $whitelist) // DEPRECATED
|| in_array($name . 'bridge', $whitelist) // DEPRECATED
|| in_array($name . 'bridge.php', $whitelist) // DEPRECATED
|| (count($whitelist) === 1 && trim($whitelist[0]) === '*')) {
return true;
} else {