aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
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);
+}
+