Fixed events query with like in tags field. Ticket #208

(cherry picked from commit 9303041450)
This commit is contained in:
Arturo Gonzalez 2017-02-10 12:30:21 +01:00
parent 7a820be983
commit 33be446e1f
1 changed files with 7 additions and 1 deletions

View File

@ -192,7 +192,13 @@ if (!empty($tag_with)) {
foreach ($tag_with as $id_tag) { foreach ($tag_with as $id_tag) {
if ($first) $first = false; if ($first) $first = false;
else $sql_post .= " AND "; else $sql_post .= " AND ";
$sql_post .= "tags LIKE '%" . tags_get_name($id_tag) . "%'"; $sql_post .= "tags LIKE '" . tags_get_name($id_tag) . "'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '" . tags_get_name($id_tag) . ",%'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '%, " . tags_get_name($id_tag) . "'";
$sql_post .= " OR ";
$sql_post .= "tags LIKE '%, " . tags_get_name($id_tag) . ",%'";
} }
$sql_post .= ' ) '; $sql_post .= ' ) ';
} }