aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-15 10:54:59 +0000
committerMario <mario@mariovavti.com>2020-10-15 10:54:59 +0000
commit61f554e0d7820b19f7ecb7b6d216f3012dc23acf (patch)
treed4e1198e9a611da907b153ac8e83c386a12973d2 /include/text.php
parent3b252d98b89b884be995f6f90e31d7e6612cf522 (diff)
downloadvolse-hubzilla-61f554e0d7820b19f7ecb7b6d216f3012dc23acf.tar.gz
volse-hubzilla-61f554e0d7820b19f7ecb7b6d216f3012dc23acf.tar.bz2
volse-hubzilla-61f554e0d7820b19f7ecb7b6d216f3012dc23acf.zip
remove new lines and tabs from xchan_name
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index 8bad8337f..af1473713 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3816,3 +3816,12 @@ function unserialise($x) {
return ((is_array($y)) ? $y : $x);
}
+/**
+ * @brief Remove new lines and tabs from strings.
+ *
+ * @return string
+ */
+function sanitize_text_field($str) {
+ return preg_replace('/\s+/S', ' ', $str);
+}
+