[pLog-svn] r7151 - in plog/branches/lifetype-1.2/class: data test/tests/data
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Wed Oct 26 19:56:15 EDT 2011
Author: jondaley
Date: 2011-10-26 19:56:15 -0400 (Wed, 26 Oct 2011)
New Revision: 7151
Modified:
plog/branches/lifetype-1.2/class/data/textfilter.class.php
plog/branches/lifetype-1.2/class/test/tests/data/textfilter_test.class.php
Log:
some more test cases - '3' and '5' don't yet work
Modified: plog/branches/lifetype-1.2/class/data/textfilter.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/textfilter.class.php 2011-10-26 23:31:50 UTC (rev 7150)
+++ plog/branches/lifetype-1.2/class/data/textfilter.class.php 2011-10-26 23:56:15 UTC (rev 7151)
@@ -67,10 +67,12 @@
}
// WP bug fix for LOVE <3 (and other situations with '<' before a number)
- $string = preg_replace('#<([0-9]+)#', '<$1', $string);
+ $string = preg_replace('/<([0-9]+)/', '<$1', $string);
// some nice people might like to use "< >" without meaning to do HTML?
- $string = preg_replace('#<( *)>#', '<$1>', $string);
+ $string = preg_replace('/<( *)>/', '<$1>', $string);
+// $string = preg_replace('/<.*>/', '<', $string);
+
$string = strip_tags( $string, $htmlAllowedTags );
$string = TextFilter::balanceTags($string);
Modified: plog/branches/lifetype-1.2/class/test/tests/data/textfilter_test.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/tests/data/textfilter_test.class.php 2011-10-26 23:31:50 UTC (rev 7150)
+++ plog/branches/lifetype-1.2/class/test/tests/data/textfilter_test.class.php 2011-10-26 23:56:15 UTC (rev 7151)
@@ -134,8 +134,12 @@
" this is a plain text comment " => " this is a plain text comment ",
"some <a>html</a><b>is</b><h1>not</h1><p>allowed</p>" =>
"some <a>html</a><b>is</b>not<p>allowed</p>",
- "non-html like < is ok" => "non-html like < is ok",
- "non-html like > is ok" => "non-html like > is ok",
+ "1 non-html like < is ok" => "1 non-html like < is ok",
+ "2 non-html like > is ok" => "2 non-html like > is ok",
+ "3 non-html like <is ok" => "3 non-html like <is ok",
+ "4 non-html like >is ok" => "4 non-html like >is ok",
+ "5 non-html like<is ok" => "5 non-html like<is ok",
+ "6 non-html like>is ok" => "6 non-html like>is ok",
"<3 is fine." => "<3 is fine.",
"so is <31231." => "so is <31231.",
"Unclosed tags should be <i> closed" => "Unclosed tags should be <i> closed</i>",
@@ -143,6 +147,7 @@
"NULL tags <> shouldn't be removed" => "NULL tags <> shouldn't be removed",
"Empty tags < > should not crash." => "Empty tags < > should not crash.",
"Weird tags <asd > aren't ok." => "Weird tags aren't ok.",
+ "Weird tags <asd> aren't ok." => "Weird tags aren't ok.",
"Other HTML is not <h1> <p>allowed</p></h1>" => "Other HTML is not <p>allowed</p>",
"HTML comments?<!-- aren't allowed" => "HTML comments?",
"Things that look like HTML comments?< !-- are ok." => "Things that look like HTML comments?< !-- are ok.",
More information about the pLog-svn
mailing list