Changeset 562


Ignore:
Timestamp:
Oct 9, 2004, 12:04:23 PM (19 years ago)
Author:
z0rglub
Message:

clean keywords string from IPTC fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_metadata.php

    r493 r562  
    5252  }
    5353
     54  if (isset($iptc['keywords']))
     55  {
     56    // keywords separator is the comma, nothing else. Allowed characters in
     57    // keywords : [A-Za-z0-9], "-" and "_". All other characters will be
     58    // considered as separators
     59    $iptc['keywords'] = preg_replace('/[^\w-]+/', ',', $iptc['keywords']);
     60    $iptc['keywords'] = preg_replace('/^,+|,+$/', '', $iptc['keywords']);
     61  }
     62
    5463  return $iptc;
    5564}
Note: See TracChangeset for help on using the changeset viewer.