use of \ to escape the comma
"a, b\, 1" will give Array ( [0] => a [1] => b, 1 ) whatever the number of \

git-svn-id: http://piwigo.org/svn/trunk@20741 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
flop25 2013-02-13 18:12:10 +00:00
parent d6abd25b6b
commit 1246fd7922

View file

@ -1977,10 +1977,10 @@ SELECT *
if (isset($params['tags']) and !empty($params['tags']))
{
$tag_ids = array();
$tag_names = explode(',', $params['tags']);
$tag_names = preg_split('~(?<!\\\),~', $params['tags']);
foreach ($tag_names as $tag_name)
{
$tag_id = tag_id_from_tag_name($tag_name);
$tag_id = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name));
array_push($tag_ids, $tag_id);
}