From 61f554e0d7820b19f7ecb7b6d216f3012dc23acf Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 15 Oct 2020 10:54:59 +0000 Subject: remove new lines and tabs from xchan_name --- include/text.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/text.php') 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); +} + -- cgit v1.2.3