deactivate entry forms when deadline is over

This commit is contained in:
marko
2023-04-15 18:03:52 +02:00
parent bed173eac2
commit a610bed879
4 changed files with 79 additions and 14 deletions

View File

@@ -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]]);
}