summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-09 22:11:49 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-07-09 22:11:49 -0700
commit311794dbcec07b8e3e0480203f3373488eb6c904 (patch)
tree2b1d1b838435c23977593a9ab4aef66cf29b4fab
parent67d78e8d58fa5060e42fcef73d3c6de19209c216 (diff)
Make the tag event handle the iptc keywords consistently with
other tag add mechanisms
-rw-r--r--modules/tag/helpers/tag_event.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index 946326c0..7a170bf8 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -34,10 +34,13 @@ class tag_event_Core {
if (!empty($iptc["2#025"])) {
foreach($iptc["2#025"] as $tag) {
$tag = str_replace("\0", "", $tag);
- if (function_exists("mb_detect_encoding") && mb_detect_encoding($tag) != "UTF-8") {
- $tag = utf8_encode($tag);
+ foreach (preg_split("/[,;]/", $tag) as $word) {
+ $word = preg_replace('/\s+/', '.', trim($word));
+ if (function_exists("mb_detect_encoding") && mb_detect_encoding($word) != "UTF-8") {
+ $word = utf8_encode($word);
+ }
+ $tags[$word] = 1;
}
- $tags[$tag] = 1;
}
}
}