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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user