aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Text.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-10 13:12:51 +0100
committerMario <mario@mariovavti.com>2024-03-10 13:12:51 +0100
commitd285da09fe59bf9269c0364964339b0f522b58c3 (patch)
tree43f5a04a61cd0ac3bb59363fd36c5871112beff7 /Zotlabs/Lib/Text.php
parentb291f1bad3e7369c51b82cba16eddedbd88fc4a2 (diff)
downloadvolse-hubzilla-d285da09fe59bf9269c0364964339b0f522b58c3.tar.gz
volse-hubzilla-d285da09fe59bf9269c0364964339b0f522b58c3.tar.bz2
volse-hubzilla-d285da09fe59bf9269c0364964339b0f522b58c3.zip
add the file
Diffstat (limited to 'Zotlabs/Lib/Text.php')
-rw-r--r--Zotlabs/Lib/Text.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Text.php b/Zotlabs/Lib/Text.php
new file mode 100644
index 000000000..a4dea90b9
--- /dev/null
+++ b/Zotlabs/Lib/Text.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Zotlabs\Lib;
+
+class Text {
+
+ /**
+ * use this on "body" or "content" input where angle chars shouldn't be removed,
+ * and allow them to be safely displayed.
+ *
+ * @param string $string
+ *
+ * @return string
+ */
+
+ public static function escape_tags(string $string): string {
+ if (!$string) {
+ return EMPTY_STR;
+ }
+
+ return (htmlspecialchars($string, ENT_COMPAT, 'UTF-8', false));
+ }
+
+}