aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/sys/textprocessors/PlainTextProcessor.php
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-09-25 21:18:18 +0200
committerLaria Carolin Chabowski <laria@laria.me>2020-09-25 21:28:55 +0200
commit378881378aab5454c84cb1fecbbcc675f64dc27f (patch)
treef8bbe239c2a87cc61bec05b987099e4401dd2693 /ratatoeskr/sys/textprocessors/PlainTextProcessor.php
parent78c0350b3b7fc025ba565e19bfa195b68e95bb88 (diff)
downloadratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.tar.gz
ratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.tar.bz2
ratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.zip
Refactor textprocessors
They are now managed by TextprocessorRepository and are instances of Textprocessor. This replaces the global $textprocessors variable.
Diffstat (limited to 'ratatoeskr/sys/textprocessors/PlainTextProcessor.php')
-rw-r--r--ratatoeskr/sys/textprocessors/PlainTextProcessor.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/ratatoeskr/sys/textprocessors/PlainTextProcessor.php b/ratatoeskr/sys/textprocessors/PlainTextProcessor.php
new file mode 100644
index 0000000..c8f13f6
--- /dev/null
+++ b/ratatoeskr/sys/textprocessors/PlainTextProcessor.php
@@ -0,0 +1,22 @@
+<?php
+
+
+namespace r7r\cms\sys\textprocessors;
+
+use r7r\cms\sys\Esc;
+
+/**
+ * A textprocessor that simply escapes the input string.
+ */
+class PlainTextProcessor implements Textprocessor
+{
+ public function apply(string $input): string
+ {
+ return Esc::esc($input, Esc::HTML_WITH_BR);
+ }
+
+ public function showInBackend(): bool
+ {
+ return true;
+ }
+}