[pLog-svn] r3785 - in plog/trunk/class: data test/tests/data
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Mon Jul 24 10:57:58 GMT 2006
Author: jondaley
Date: 2006-07-24 10:57:57 +0000 (Mon, 24 Jul 2006)
New Revision: 3785
Modified:
plog/trunk/class/data/textfilter.class.php
plog/trunk/class/test/tests/data/textfilter_test.class.php
Log:
strip html tags from slug
Modified: plog/trunk/class/data/textfilter.class.php
===================================================================
--- plog/trunk/class/data/textfilter.class.php 2006-07-24 06:42:52 UTC (rev 3784)
+++ plog/trunk/class/data/textfilter.class.php 2006-07-24 10:57:57 UTC (rev 3785)
@@ -527,7 +527,7 @@
$validChars = "_0-9a-zA-Z.-";
}
// remove "bad" characters
- $string = preg_replace("/[^".$validChars."]/", $separator, Textfilter::htmlDecode($string));
+ $string = preg_replace("/[^".$validChars."]/", $separator, strip_tags(Textfilter::htmlDecode($string)));
// remove doubled separators
$string = preg_replace("/[".$separator."]+/", $separator, $string);
// remove starting and trailing separator chars
Modified: plog/trunk/class/test/tests/data/textfilter_test.class.php
===================================================================
--- plog/trunk/class/test/tests/data/textfilter_test.class.php 2006-07-24 06:42:52 UTC (rev 3784)
+++ plog/trunk/class/test/tests/data/textfilter_test.class.php 2006-07-24 10:57:57 UTC (rev 3785)
@@ -31,7 +31,7 @@
"two spaces" => "two{$sep}spaces",
" leadingblanks" => "leadingblanks",
"trailingblanks " => "trailingblanks",
- "<a>html</a><b>is</b><h1>not</h1><p>allowed</p>" => "a{$sep}html{$sep}a{$sep}b{$sep}is{$sep}b{$sep}h1{$sep}not{$sep}h1{$sep}p{$sep}allowed{$sep}p"
+ "<a>html</a><b>is</b><h1>not</h1><p>allowed</p>" => "htmlisnotallowed"
);
// process each one of them
More information about the pLog-svn
mailing list