Fix bug when there is an event with a bad data in custom_data - #311

This commit is contained in:
enriquecd 2017-06-07 17:55:53 +02:00
parent 1517a7f0e0
commit 777713f939
1 changed files with 6 additions and 2 deletions

View File

@ -81,16 +81,20 @@ $events_wi_cdata = db_get_all_rows_sql('SELECT id_evento,custom_data from tevent
$count_events = 0;
$events_wi_cdata_id = 'OR id_evento IN (';
foreach ($events_wi_cdata as $key => $value) {
if(strpos(base64_decode($value['custom_data']),$search) != false){
if(strpos(strtolower(base64_decode($value['custom_data'])),strtolower($search)) != false){
$events_wi_cdata_id .= $value['id_evento'];
$count_events++;
}
if ($value !== end($events_wi_cdata) && $count_events > 0) {
$events_wi_cdata_id .= ',';
$events_wi_cdata_id = str_replace(',,', ',', $events_wi_cdata_id);
}
}
$events_wi_cdata_id .= ')';
$events_wi_cdata_id = str_replace(',)', ')', $events_wi_cdata_id);
if($count_events == 0){
$events_wi_cdata_id = '';
}