# HG changeset patch # User Dan Fuhry # Date 1323749733 18000 # Node ID c8e6db42385f83b4cf706b2aaed76b3515e6b517 # Parent bfc5494ee70cfcb982b91b3770feaaa203204182 Fix assumption that all blocks are at least 1 byte long diff -r bfc5494ee70c -r c8e6db42385f 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\/].+?|!--.+?--)>|]*>[\w\W]*?<\/script>)/', $text, NULL, PREG_SPLIT_DELIM_CAPTURE); foreach ( $text as &$block ) { + if ( strlen($block) < 1 ) + continue; if ( $block{0} == '<' ) continue;