Fix assumption that all blocks are at least 1 byte long
authorDan Fuhry <dan@enanocms.org>
Mon, 12 Dec 2011 23:15:33 -0500
changeset 2 c8e6db42385f
parent 1 bfc5494ee70c
child 3 28a899aa460e
Fix assumption that all blocks are at least 1 byte long
Censorship.php
--- a/Censorship.php	Mon Dec 12 23:12:47 2011 -0500
+++ b/Censorship.php	Mon Dec 12 23:15:33 2011 -0500
@@ -23,6 +23,8 @@
 	$text = preg_split('/(<(?:[a-z\/].+?|!--.+?--)>|<script[^>]*>[\w\W]*?<\/script>)/', $text, NULL, PREG_SPLIT_DELIM_CAPTURE);
 	foreach ( $text as &$block )
 	{
+		if ( strlen($block) < 1 )
+			continue;
 		if ( $block{0} == '<' )
 			continue;