From 92a5add47382cd41e782f45ef47e46806acdd615 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 25 Dec 2011 17:58:03 +0100 Subject: Restructured directory tree and class names (I'm not happy with it still) Some improvements in the client --- lib/kolab_utils.php | 141 +++++++++++++++++++++++++++++----------------------- 1 file changed, 80 insertions(+), 61 deletions(-) (limited to 'lib/kolab_utils.php') diff --git a/lib/kolab_utils.php b/lib/kolab_utils.php index 97b8bdf..1acd4ba 100644 --- a/lib/kolab_utils.php +++ b/lib/kolab_utils.php @@ -1,78 +1,97 @@ $val) { + $value[$idx] = self::parse_input($val, $allow_html); } + } + // remove HTML tags if not allowed + else if (!$allow_html) { + $value = strip_tags($value); + } - if (is_array($value)) { - foreach ($value as $idx => $val) { - $value[$idx] = self::parse_input($val, $allow_html); - } - } - // remove HTML tags if not allowed - else if (!$allow_html) { - $value = strip_tags($value); - } + return $value; + } - return $value; - } + /** + * Make sure the string ends with a slash + */ + public static function slashify($str) + { + return self::unslashify($str).'/'; + } + /** + * Remove slash at the end of the string + */ + public static function unslashify($str) + { + return preg_replace('/\/$/', '', $str); } -?> +} -- cgit v1.1