From 2cab677427f7fd462f35432d4a83fe89a26d7595 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 9 Jul 2008 09:55:42 +0000 Subject: Elgg 1.0, meet kses. Kses, Elgg 1.0. git-svn-id: https://code.elgg.org/elgg/trunk@1344 36083f99-b078-4883-b0ff-0f9b5a30f544 --- vendors/kses/examples/filter.php | 138 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 vendors/kses/examples/filter.php (limited to 'vendors/kses/examples/filter.php') diff --git a/vendors/kses/examples/filter.php b/vendors/kses/examples/filter.php new file mode 100644 index 000000000..9a026795b --- /dev/null +++ b/vendors/kses/examples/filter.php @@ -0,0 +1,138 @@ + array(), + 'i' => array(), + 'a' => array('href' => array('minlen' => 3, 'maxlen' => 50), + 'title' => array('valueless' => 'n')), + 'p' => array('align' => 1, + 'dummy' => array('valueless' => 'y')), + 'img' => array('src' => 1), # FIXME + 'font' => array('size' => + array('minval' => 4, 'maxval' => 20)), + 'br' => array()); + +$val = $_POST['val']; +if (get_magic_quotes_gpc()) + $val = stripslashes($val); + +# *** PRINT SOME HTML CODE *** + +?> + + + +kses example: HTML filter + + + + + + +

Input

+ +
+ + +

Output

+ +
+ + +

Type something

+ +
+ +
+ +
+ + +

+Only the following HTML elements and attributes are allowed: +

+ +

+ $htmlval) +{ + if (!$first) + echo ' '; + $first = 0; + + echo "<$htmlkey"; # element + + foreach ($htmlval as $html2key => $html2val) + echo " $html2key="; # attribute + + echo ">"; +} + +?> + +

+ +

+<a href=> must have a length in the range 3 to 50.
+<a title=> must not be valueless.
+<p dummy> must be valueless.
+<font size=> must have a value in the range 4 to 20.
+Only the URL protocols "http" and "https" are allowed. +

+ + + -- cgit v1.2.3