Permalink
Browse files

Clean enum values

  • Loading branch information...
adrianheine committed Jun 30, 2010
1 parent dac3a3d commit 948a57d761208221e97af8e11042951dfb176d99
Showing with 7 additions and 0 deletions.
  1. +7 −0 admin/aliases.php
View
@@ -44,6 +44,13 @@ function handle() {
$row['name'] = utf8_strtolower($row['name']);
$row['name'] = rtrim($row['name'],'s');
if(!$row['name']) continue;
+
+ // Clean enum
+ $arr = preg_split('/\s*,\s*/', $row['enum']);
+ $arr = array_unique($arr);
+ asort($arr);
+ $row['enum'] = implode(', ', $arr);
+
$sqlite->query("INSERT INTO aliases (name, type, prefix, postfix, enum)
VALUES (?,?,?,?,?)",$row);
}

0 comments on commit 948a57d

Please sign in to comment.