diff --git a/src/Util/Query.php b/src/Util/Query.php index c20a74131..fef77079b 100755 --- a/src/Util/Query.php +++ b/src/Util/Query.php @@ -225,8 +225,19 @@ class Query $search_filters[] = $search_query.' '.$sign.' '.prepare($value); } } elseif ($equal) { - $value = trim(str_replace(['='], '', $value)); - $search_filters[] = ($search_query.' = '.prepare($value).' OR '.$search_query.' LIKE '.prepare('% '.$value).' OR '.$search_query.' LIKE '.prepare($value.' %').' OR '.$search_query.' LIKE '.prepare('% '.$value.' %')); + $value = trim(str_replace(['='], '', $value)); + list($giorno, $mese, $anno) = explode('/', $value); + $data = "'".$anno.'-'.$mese.'-'.$giorno."'"; + + if ($anno != '' && $giorno != '' && $mese != '') { + if ($data != "'1970-01-01'") { + $search_filters[] = $search_query.' = '.$data.''; + } + + } else { + $search_filters[] = ($search_query.' = '.prepare($value).' OR '.$search_query.' LIKE '.prepare('% '.$value).' OR '.$search_query.' LIKE '.prepare($value.' %').' OR '.$search_query.' LIKE '.prepare('% '.$value.' %')); + } + } elseif ($notequal) { $value = trim(str_replace(['!='], '', $value)); $search_filters[] = ($search_query.' != '.prepare($value).' AND '.$search_query.' NOT LIKE '.prepare('% '.$value).' AND '.$search_query.' NOT LIKE '.prepare($value.' %').' AND '.$search_query.' NOT LIKE '.prepare('% '.$value.' %'));