Fix bug when there is an event with a bad data in custom_data - #311
This commit is contained in:
parent
1517a7f0e0
commit
777713f939
|
@ -81,16 +81,20 @@ $events_wi_cdata = db_get_all_rows_sql('SELECT id_evento,custom_data from tevent
|
||||||
$count_events = 0;
|
$count_events = 0;
|
||||||
$events_wi_cdata_id = 'OR id_evento IN (';
|
$events_wi_cdata_id = 'OR id_evento IN (';
|
||||||
foreach ($events_wi_cdata as $key => $value) {
|
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'];
|
$events_wi_cdata_id .= $value['id_evento'];
|
||||||
$count_events++;
|
$count_events++;
|
||||||
}
|
}
|
||||||
if ($value !== end($events_wi_cdata) && $count_events > 0) {
|
if ($value !== end($events_wi_cdata) && $count_events > 0) {
|
||||||
$events_wi_cdata_id .= ',';
|
$events_wi_cdata_id .= ',';
|
||||||
|
$events_wi_cdata_id = str_replace(',,', ',', $events_wi_cdata_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$events_wi_cdata_id .= ')';
|
$events_wi_cdata_id .= ')';
|
||||||
|
|
||||||
|
$events_wi_cdata_id = str_replace(',)', ')', $events_wi_cdata_id);
|
||||||
|
|
||||||
if($count_events == 0){
|
if($count_events == 0){
|
||||||
$events_wi_cdata_id = '';
|
$events_wi_cdata_id = '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue