diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-10 13:11:49 +0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-10 13:13:24 +0800 |
commit | a059eff25d3e4975f39ad04181039d4544e47059 (patch) | |
tree | c5b89dc488764088b654443eb91e1e02b3007667 | |
parent | f4f6dacf7dd6f96c47db0486ab56c3ab546ba4ac (diff) |
Make the tag event handle the iptc keywords consistently with
other tag add mechanisms
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
-rw-r--r-- | modules/tag/helpers/tag_event.php | 9 |
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; } } } |