deactivate entry forms when deadline is over
This commit is contained in:
@@ -564,3 +564,17 @@ function filterId($id)
|
||||
{
|
||||
return filter_var($id, FILTER_VALIDATE_INT, ['options' => ['default' => null, 'min_range' => 1]]);
|
||||
}
|
||||
|
||||
/** filter a variable as count
|
||||
*
|
||||
* - count means a non negative integer
|
||||
* - helper function to stay DRY
|
||||
*
|
||||
* @param mixed $variable
|
||||
* @param integer $min
|
||||
* @return integer the input variable as integer >= 0
|
||||
*/
|
||||
function filterCount($variable, int $min = 0){
|
||||
return filter_var($variable, FILTER_VALIDATE_INT, ['options' => ['default' => null, 'min_range' => 1]]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user