From d64cc48d4e6c318768b5e962aa23f7910ae23f7a Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 12 Nov 2012 21:25:17 +0200 Subject: [PATCH] Text Helper: method strpSlashes() fixed. --- monstra/helpers/text.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/monstra/helpers/text.php b/monstra/helpers/text.php index ebe8b39..7ffcbbe 100644 --- a/monstra/helpers/text.php +++ b/monstra/helpers/text.php @@ -97,22 +97,20 @@ * echo Text::strpSlashes('some \ text \ here'); * * - * @param string $str String with slashes - * @return string + * @param mixed $str String or array of strings with slashes + * @return mixed */ public static function strpSlashes($str) { - // Redefine vars - $str = (string) $str; - if (is_array($str)) { foreach ($str as $key => $val) { - $str[$key] = stripslashes($val); + $result[$key] = stripslashes($val); } } else { - $str = stripslashes($str); + $result = stripslashes($str); } - return $str; + + return $result; }