sanitize title better
[phinde.git] / src / phinde / Helper.php
index 40ea751442a2b62eb17e84a09694b5abbe41d34b..312c5e54a35ba4790c15842ca349504f241468ac 100644 (file)
@@ -30,5 +30,16 @@ class Helper
         }
         return 'http://' . $url;
     }
+
+    public static function sanitizeTitle($str)
+    {
+        return trim(
+            str_replace(
+                array("\r", "\n", '  ', '  '),
+                array('', ' ', ' ', ' '),
+                $str
+            )
+        );
+    }
 }
 ?>