Changeset 565 for trunk/tools


Ignore:
Timestamp:
Oct 9, 2004, 1:43:01 PM (20 years ago)
Author:
z0rglub
Message:

clean keywords string from IPTC fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/create_listing_file.php

    r564 r565  
    126126      }
    127127    }
     128  }
     129
     130  if (isset($iptc['keywords']))
     131  {
     132    // keywords separator is the comma, nothing else. Allowed characters in
     133    // keywords : [A-Za-z0-9], "-" and "_". All other characters will be
     134    // considered as separators
     135    $iptc['keywords'] = preg_replace('/[^\w-]+/', ',', $iptc['keywords']);
     136    $iptc['keywords'] = preg_replace('/^,+|,+$/', '', $iptc['keywords']);
    128137  }
    129138
Note: See TracChangeset for help on using the changeset viewer.