From 64786741d7155f8851de678caa0e11aea7032808 Mon Sep 17 00:00:00 2001 From: Parziphal Date: Sun, 3 Nov 2013 12:01:28 -0500 Subject: [PATCH] fixed DText, added htmLawed for validation --- .gitignore | 1 + lib/DText.php | 8 +- vendor/htmLawed/htmLawed.php | 723 +++++++++++ vendor/htmLawed/htmLawed_README.txt | 1734 +++++++++++++++++++++++++++ 4 files changed, 2463 insertions(+), 3 deletions(-) create mode 100755 vendor/htmLawed/htmLawed.php create mode 100755 vendor/htmLawed/htmLawed_README.txt diff --git a/.gitignore b/.gitignore index dbac8bc..741570b 100755 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ !/vendor/assets !/vendor/Horde !/vendor/ZipStream.php +!/vendor/htmLawed diff --git a/lib/DText.php b/lib/DText.php index 2cb6c86..697c414 100755 --- a/lib/DText.php +++ b/lib/DText.php @@ -34,7 +34,9 @@ class DText # Parse inline tags as a whole. $result = self::parseinline($result); - return $result; + # htmLawed ensures valid html output. + require_once Rails::root() . '/vendor/htmLawed/htmLawed.php'; + return htmLawed($result); } static public function parseinline($str) @@ -126,7 +128,7 @@ class DText $state[] = "1"; $html .= '', $last - $n); @@ -135,7 +137,7 @@ class DText } elseif ($n > $last) { $html .= '