- Patch #1078398 by xjm, BayerMeister: Fixed taxonomy_implode_tags() modifies term objects (instead of cloning) and adds extra ' when called multiple times.

merge-requests/26/head
Dries Buytaert 2011-08-12 09:40:09 -04:00
parent b434559af5
commit a8fd86946e
1 changed files with 4 additions and 3 deletions

View File

@ -1236,13 +1236,14 @@ function taxonomy_implode_tags($tags, $vid = NULL) {
if (isset($tag->name)) {
// Commas and quotes in tag names are special cases, so encode 'em.
if (strpos($tag->name, ',') !== FALSE || strpos($tag->name, '"') !== FALSE) {
$tag->name = '"' . str_replace('"', '""', $tag->name) . '"';
$typed_tags[] = '"' . str_replace('"', '""', $tag->name) . '"';
}
else {
$typed_tags[] = $tag->name;
}
}
}
}
return implode(', ', $typed_tags);
}