summaryrefslogtreecommitdiff
path: root/tests/test_autoescape/code.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2015-04-13 22:35:27 +0200
committerKevin Chabowski <kevin@kch42.de>2015-04-13 22:35:27 +0200
commitf744b3227b116d4f7ccd7c71f8b8498ebf86d85f (patch)
tree87a2ea0047c7587375986d3b1a2a31c05e8d36ce /tests/test_autoescape/code.php
parent6d1c13b05d16e89268403860e47743455ea0a2ff (diff)
downloadste-f744b3227b116d4f7ccd7c71f8b8498ebf86d85f.tar.gz
ste-f744b3227b116d4f7ccd7c71f8b8498ebf86d85f.tar.bz2
ste-f744b3227b116d4f7ccd7c71f8b8498ebf86d85f.zip
Implemented autoescaping
Still needs some cleanup and documentation.
Diffstat (limited to 'tests/test_autoescape/code.php')
-rw-r--r--tests/test_autoescape/code.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_autoescape/code.php b/tests/test_autoescape/code.php
new file mode 100644
index 0000000..4f7c998
--- /dev/null
+++ b/tests/test_autoescape/code.php
@@ -0,0 +1,14 @@
+<?php
+
+use kch42\ste\STECore;
+
+function test_func($ste) {
+ $ste->vars['test'] = 'foo"&<bar>';
+
+ $ste->register_tag('echoarg', function ($ste, $params, $sub) {
+ return $params['echo'];
+ });
+
+ // Autoescaping enabled by default
+ $ste->escape_method = STECore::ESCAPE_HTML;
+}