From d8c39f2b0571b9734259b2f9dc218eed24412332 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 11 Feb 2016 17:37:12 +0100 Subject: sanitize title better --- src/phinde/Helper.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/phinde/Helper.php') diff --git a/src/phinde/Helper.php b/src/phinde/Helper.php index 40ea751..312c5e5 100644 --- a/src/phinde/Helper.php +++ b/src/phinde/Helper.php @@ -30,5 +30,16 @@ class Helper } return 'http://' . $url; } + + public static function sanitizeTitle($str) + { + return trim( + str_replace( + array("\r", "\n", ' ', ' '), + array('', ' ', ' ', ' '), + $str + ) + ); + } } ?> -- cgit v1.2.3