| @@ -68,10 +68,9 @@ | ||
| 68 | 68 | $ticketsQuery->searchBy($search); |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $ticketsQuery->orderBy($this->args['sort_by'], $this->args['sort_type']); | |
| 73 | - | |
| 72 | + $ticketsQuery->orderBy(sanitize_sql_orderby($this->args['sort_by']), sanitize_sql_orderby($this->args['sort_type'])); | |
| 74 | 73 | do_action_ref_array('fluent_support\main_tickets_query', [&$ticketsQuery, $this->args]); |
| 75 | 74 | $this->model = $ticketsQuery; |
| 76 | 75 | } |
| 77 | 76 | |
| @@ -111,19 +110,20 @@ | ||
| 111 | 110 | foreach ($filters as $filterGroup) { |
| 112 | 111 | $group = []; |
| 113 | 112 | //$filterItem is individual item under a group(And/OR) |
| 114 | 113 | foreach ($filterGroup as $filterItem) { |
| 115 | - if (count($filterItem['source']) != 2 || empty($filterItem['source'][0]) || empty($filterItem['source'][1]) || empty($filterItem['operator'])) { | |
| 114 | + $source = $filterItem['source'] ?? []; | |
| 115 | + if (!is_array($source) || count($source) != 2 || empty($source[0]) || empty($source[1]) || empty($filterItem['operator'])) { | |
| 116 | 116 | continue; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $provider = $filterItem['source'][0]; | |
| 119 | + $provider = $source[0]; | |
| 120 | 120 | |
| 121 | 121 | if (!isset($group[$provider])) { |
| 122 | 122 | $group[$provider] = []; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $property = $filterItem['source'][1]; | |
| 125 | + $property = $source[1]; | |
| 126 | 126 | |
| 127 | 127 | $group[$provider][] = [ |
| 128 | 128 | 'property' => $property, |
| 129 | 129 | 'operator' => $filterItem['operator'], |