From 949e0f2326a6f3268b511110903aec472315b5b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 May 2020 17:27:12 +0200 Subject: [PATCH] Fix filter on language --- htdocs/website/class/websitepage.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 84eaf0efb27..c63823f51a1 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -332,7 +332,11 @@ class WebsitePage extends CommonObject if ($key == 't.rowid' || $key == 't.fk_website') { $sqlwhere[] = $key.'='.$value; } elseif ($key == 'lang' || $key == 't.lang') { - $sqlwhere[] = $key." = '".$this->db->escape(substr($value, 0, 2))."'"; + $listoflang = array(); + foreach(explode(',', $value) as $tmpvalue) { + $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; + } + $sqlwhere[] = $key." IN (".join(',', $listoflang).")"; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; }