Add AJAX category management system. Includes suggestion system, dialogs for setting...
[lhc/web/wiklou.git] / includes / Categoryfinder.php
index 4413bd1..7c1c285 100644 (file)
@@ -53,9 +53,11 @@ class Categoryfinder {
                # Set the list of target categories; convert them to DBKEY form first
                $this->targets = array () ;
                foreach ( $categories AS $c ) {
-                       $ct = Title::newFromText ( $c , NS_CATEGORY ) ;
-                       $c = $ct->getDBkey () ;
-                       $this->targets[$c] = $c ;
+                       $ct = Title::makeTitleSafe( NS_CATEGORY, $c );
+                       if( $ct ) {
+                               $c = $ct->getDBkey();
+                               $this->targets[$c] = $c;
+                       }
                }
        }