diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index c63823f51a1..edf1eed51a7 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -333,10 +333,17 @@ class WebsitePage extends CommonObject $sqlwhere[] = $key.'='.$value; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); + $foundnull = 0; foreach(explode(',', $value) as $tmpvalue) { + if ($tmpvalue == 'null') { + $foundnull++; + continue; + } $listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'"; } - $sqlwhere[] = $key." IN (".join(',', $listoflang).")"; + $stringtouse = $key." IN (".join(',', $listoflang).")"; + if ($foundnull) $stringtouse = '('.$stringtouse.' OR '.$key.' IS NULL)'; + $sqlwhere[] = $stringtouse; } else { $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; }