1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-06 21:26:58 +02:00

Text Helper: method strpSlashes() fixed.

This commit is contained in:
Awilum
2012-11-12 21:25:17 +02:00
parent 042075c89a
commit d64cc48d4e

View File

@@ -97,22 +97,20 @@
* echo Text::strpSlashes('some \ text \ here'); * echo Text::strpSlashes('some \ text \ here');
* </code> * </code>
* *
* @param string $str String with slashes * @param mixed $str String or array of strings with slashes
* @return string * @return mixed
*/ */
public static function strpSlashes($str) { public static function strpSlashes($str) {
// Redefine vars
$str = (string) $str;
if (is_array($str)) { if (is_array($str)) {
foreach ($str as $key => $val) { foreach ($str as $key => $val) {
$str[$key] = stripslashes($val); $result[$key] = stripslashes($val);
} }
} else { } else {
$str = stripslashes($str); $result = stripslashes($str);
} }
return $str;
return $result;
} }