fix bug causing sql syntax error

On fresh installations `explode` wouldn't result in an array containing an empty string which causes a SQL syntax error. Use `preg_split` instead.