$where[] = sprintf ("datum < '%04d-01-01'", $_POST[year]+1);
}
- if (strlen($_POST[deadline])) {
+ if (strlen($_POST[deadline]) && strlen(trim($_POST[deadline]))) {
$date = form_to_yyyymmdd ($_POST[deadline]);
$where[] = sprintf ("datum < '%s'", $date);
}
- if (strlen($_POST[statement])) {
+ if (strlen($_POST[statement]) && strlen(trim($_POST[statement]))) {
$where[] = "statement = '$_POST[statement]'";
}
- if (strlen($_POST[category])) {
+ if (strlen($_POST[category]) && strlen(trim($_POST[category]))) {
$where[] = "category = '$_POST[category]'";
}
- if (strlen($_POST[keyword])) {
+ if (strlen($_POST[keyword]) && strlen(trim($_POST[keyword]))) {
$where[] = "descr ~* '$_POST[keyword]'";
}
- if (strlen($_POST[from_to])) {
+ if (strlen($_POST[from_to]) && strlen(trim($_POST[from_to]))) {
$where[] = "from_to = '$_POST[from_to]'";
}