mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-13 21:31:35 +02:00
clean keywords string from IPTC fields
git-svn-id: http://piwigo.org/svn/trunk@565 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user