update secure media backend

This commit is contained in:
2023-09-25 19:36:44 +10:00
parent 2913960bcb
commit 6cb7a8cb43
12 changed files with 189 additions and 431 deletions

View File

@@ -55,3 +55,24 @@ function arrayDefaultValue(string $key, array $arr, mixed $value): mixed
return $value;
}
/**
* Return if an item exists in an array, case insensitive
*
* @param string $val The value to check.
* @param array $arr The array to check.
* @return bool
*/
function existsInArray(string $val, array $arr): bool
{
$exists = false;
foreach ($arr as $el) {
if (strcasecmp($val, $el) === 0) {
$exists = true;
break;
}
}
return $exists;
}