Add validation, remove redundant validation
This commit is contained in:
parent
e36671eceb
commit
a5b990846d
|
@ -49,17 +49,20 @@
|
||||||
*/
|
*/
|
||||||
private function parseSettings(&$settings) {
|
private function parseSettings(&$settings) {
|
||||||
foreach ($settings as &$overboard) {
|
foreach ($settings as &$overboard) {
|
||||||
if (!is_numeric($overboard['thread_limit']))
|
if (!is_int($overboard['thread_limit']) || $overboard['thread_limit'] < 1)
|
||||||
{
|
{
|
||||||
error('Invalid configuration parameters.', true);
|
error('thread_limit must be an integer above 1.', true);
|
||||||
}
|
}
|
||||||
|
if (!is_array($overboard['exclude']))
|
||||||
$overboard['thread_limit'] = intval($overboard['thread_limit']);
|
|
||||||
|
|
||||||
if ($overboard['thread_limit'] < 1)
|
|
||||||
{
|
{
|
||||||
error('Invalid configuration parameters.', true);
|
error('Exclude list must be array of strings.', true);
|
||||||
}
|
}
|
||||||
|
foreach ($overboard['exclude'] as &$board) {
|
||||||
|
if (!is_string($board)){
|
||||||
|
error('Exclude list must be array of strings.', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $settings;
|
return $settings;
|
||||||
|
|
Loading…
Reference in New Issue