diff options
author | z0rglub <z0rglub@piwigo.org> | 2004-10-09 11:43:01 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2004-10-09 11:43:01 +0000 |
commit | e498aca2f8c9471d2be62aa08bc31b26024ca347 (patch) | |
tree | ae228223c165f69b79a0395afe9866d0f7632bf2 | |
parent | 75cfef6e6d5b02e7b5119f4d1985d8cfa94c8480 (diff) |
clean keywords string from IPTC fields
git-svn-id: http://piwigo.org/svn/trunk@565 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | tools/create_listing_file.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/create_listing_file.php b/tools/create_listing_file.php index e0de87a88..c0935fb6b 100644 --- a/tools/create_listing_file.php +++ b/tools/create_listing_file.php @@ -127,6 +127,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; } |