summaryrefslogtreecommitdiff
path: root/src/web/helpers/sanitize.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/helpers/sanitize.php')
-rw-r--r--src/web/helpers/sanitize.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/web/helpers/sanitize.php b/src/web/helpers/sanitize.php
new file mode 100644
index 0000000..5d37852
--- /dev/null
+++ b/src/web/helpers/sanitize.php
@@ -0,0 +1,8 @@
+<?php /* Copyright (c) 2024 Freya Murphy */
+
+function esc($data) {
+ $data = str_replace('&', '&amp;', $data);
+ $data = str_replace('<', '&lt;', $data);
+ $data = str_replace('>', '&gt;', $data);
+ return $data;
+}