From ad81861c331f60ec8c19ea11e47e2826660fa142 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 31 May 2009 00:11:02 -0700 Subject: First pass at an XSS security test, along with the "p" helper which can clean HTML output. --- modules/gallery/helpers/p.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 modules/gallery/helpers/p.php (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/p.php b/modules/gallery/helpers/p.php new file mode 100644 index 00000000..69032840 --- /dev/null +++ b/modules/gallery/helpers/p.php @@ -0,0 +1,33 @@ +purify($dirty_html)); + } + + function clean($dirty_html) { + // return $dirty_html; + return htmlentities($dirty_html, ENT_QUOTES); + // return Purify::instance()->purify($dirty_html); + } +} -- cgit v1.2.3