aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-10-09 10:04:23 +0000
committerz0rglub <z0rglub@piwigo.org>2004-10-09 10:04:23 +0000
commitbfe13288a1d1230aeac6e849bc98360118b23b64 (patch)
tree29efa8ce78d7b40ab13323c3ed9f96a096b21a3c
parentb70963317a64393887e29c92f5e9ce1e492e1207 (diff)
clean keywords string from IPTC fields
git-svn-id: http://piwigo.org/svn/trunk@562 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/include/functions_metadata.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php
index 14d5a0d16..9dadd29d3 100644
--- a/admin/include/functions_metadata.php
+++ b/admin/include/functions_metadata.php
@@ -51,6 +51,15 @@ function get_sync_iptc_data($file)
}
}
+ if (isset($iptc['keywords']))
+ {
+ // keywords separator is the comma, nothing else. Allowed characters in
+ // keywords : [A-Za-z0-9], "-" and "_". All other characters will be
+ // considered as separators
+ $iptc['keywords'] = preg_replace('/[^\w-]+/', ',', $iptc['keywords']);
+ $iptc['keywords'] = preg_replace('/^,+|,+$/', '', $iptc['keywords']);
+ }
+
return $iptc;
}