// If a catgegory ID is supplied
if ($catId = filter_var( $categoryId, FILTER_VALIDATE_INT )) {
$events = $this->getEventsByCategory( $catId, $limit );
- // Else if a category name is supplied
- } else if ($term = filter_var( $categoryId, FILTER_SANITIZE_STRING )) {
- $searchTerm = $this->wpdb->esc_like( $term );
- $where .= "T.name like '%" . $searchTerm . "%'
+ // Else if a event name is supplied
+ } else if ($term = filter_var( $categoryId, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES )) {
+ $searchTerm = $this->wpdb->esc_like( stripslashes( $term ) );
+ $where .= "T.name like '%" . $term . "%'
AND T.status = " . $this->config['status_numb']['Active'] . "
AND T.id IN (
SELECT event
)
";
$order = "T.id";
- //$order .= " LIMIT {$limit} OFFSET 0";
- //echo '<pre>$order: ' . print_r($order, true) . '</pre>';
$events = $this->getList( $where, $order );
- //echo '<pre>$events: ' . print_r($events, true) . '</pre>';
// Otherwise get all categories
} else {
$where .= "T.status = " . $this->config['status_numb']['Active'] . "
}
//echo '<pre>$this->dateRange: ' . print_r($this->dateRange, true) . '</pre>';
- if (isset($_REQUEST['event_name']) && $eventNameSearch = filter_var($_REQUEST['event_name'], FILTER_SANITIZE_STRING)) {
+ if (isset($_REQUEST['event_name'])
+ && $eventNameSearch = filter_var($_REQUEST['event_name'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES)) {
$search = true;
$action = 'event-list-name';
} else {
'catEvents' => $categoryEvents,
'fromDate' => $fromDate,
'toDate' => $toDate,
- 'eventName' => $eventNameSearch,
+ 'eventName' => stripslashes( $eventNameSearch ),
'imgUrl' => GLM_MEMBERS_PLUGIN_MEDIA_URL . '/images/small/',
'calDates' => $calDates
);