diff options
author | plegall <plg@piwigo.org> | 2006-04-20 21:12:45 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2006-04-20 21:12:45 +0000 |
commit | 599665c2cf83fa924eb5ca0e71a176aaa714ce33 (patch) | |
tree | 3347a648d701a16cb63eed8288b5913e6536a747 /admin/include | |
parent | 81abfe32ecd8575aa216a892e7b96525c0decbed (diff) |
bug 339 fixed: crash on metadata synchronization when duplicate keywords.
improvement: tools/metadata.php is nearer of what metadata synchronization
uses (concerning keywords)
git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1222 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include')
-rw-r--r-- | admin/include/functions_metadata.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php index 1df03ba43..f468ab7e3 100644 --- a/admin/include/functions_metadata.php +++ b/admin/include/functions_metadata.php @@ -53,6 +53,16 @@ function get_sync_iptc_data($file) // official keywords separator is the comma $iptc['keywords'] = preg_replace('/[.;]/', ',', $iptc['keywords']); $iptc['keywords'] = preg_replace('/^,+|,+$/', '', $iptc['keywords']); + + $iptc['keywords'] = implode( + ',', + array_unique( + explode( + ',', + $iptc['keywords'] + ) + ) + ); } return $iptc; |