Improve args for UFC_NameTokens
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 30 Apr 2010 22:24:39 +0000 (00:24 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 30 Apr 2010 22:24:39 +0000 (00:24 +0200)
allow a single token ; a call to pl_flatten might be
useful here

Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/userfilter.php

index 3bee221..f9a5202 100644 (file)
@@ -340,7 +340,11 @@ class UFC_NameTokens implements UserFilterCondition
 
     public function __construct($tokens, $flags = array(), $soundex = false, $exact = false)
     {
-        $this->tokens = $tokens;
+        if (is_array($tokens)) {
+            $this->tokens = $tokens;
+        } else {
+            $this->tokens = array($tokens);
+        }
         if (is_array($flags)) {
             $this->flags = $flags;
         } else {