Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.362
diff -u -p -r1.362 filter.module
--- modules/filter/filter.module	14 Jan 2011 08:33:46 -0000	1.362
+++ modules/filter/filter.module	10 Feb 2011 10:49:16 -0000
@@ -1590,11 +1590,11 @@ function _filter_autop($text) {
   // All block level tags
   $block = '(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|p|h[1-6]|hr)';
 
-  // Split at opening and closing PRE, SCRIPT, STYLE, OBJECT tags and comments.
+  // Split at opening and closing PRE, SCRIPT, STYLE, OBJECT, IFRAME tags and comments.
   // We don't apply any processing to the contents of these tags to avoid messing
   // up code. We look for matched pairs and allow basic nesting. For example:
   // "processed <pre> ignored <script> ignored </script> ignored </pre> processed"
-  $chunks = preg_split('@(<!--.*?-->|</?(?:pre|script|style|object|!--)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
+  $chunks = preg_split('@(<!--.*?-->|</?(?:pre|script|style|object|iframe|!--)[^>]*>)@i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
   // Note: PHP ensures the array consists of alternating delimiters and literals
   // and begins and ends with a literal (inserting NULL as required).
   $ignore = FALSE;
@@ -1603,7 +1603,7 @@ function _filter_autop($text) {
   foreach ($chunks as $i => $chunk) {
     if ($i % 2) {
       // Opening or closing tag?
-      $open = ($chunk[1] != '/' || $chunk[1] != '!');
+      $open = ($chunk[1] != '/' && $chunk[1] != '!');
       $comment = (substr($chunk, 0, 4) == '<!--');
       list($tag) = preg_split('/[ >]/', substr($chunk, 2 - $open), 2);
       if (!$ignore) {
Index: modules/filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.84
diff -u -p -r1.84 filter.test
--- modules/filter/filter.test	4 Feb 2011 18:42:21 -0000	1.84
+++ modules/filter/filter.test	10 Feb 2011 10:49:17 -0000
@@ -833,6 +833,15 @@ class FilterUnitTestCase extends DrupalU
       '<blockquote><pre>aaa</pre></blockquote>' => array(
         "<blockquote><pre>aaa</pre></blockquote>" => TRUE,
       ),
+      // Bug 1054632, line breaks stopped working after an ignored chunk such
+      // as <pre>.
+      "aaa\n\n<pre>bbb</pre>ccc\n\nddd" => array(
+        "<p>aaa</p>\n<pre>bbb</pre><p>ccc</p>\n<p>ddd</p>" => TRUE,
+      ),
+      // Bug 810824, paragraphs were appearing around iframe tags.
+      "aaa\n\n<iframe>aaa</iframe>\n\nbbb" => array(
+        "<p>aaa</p>\n<p><iframe>aaa</iframe></p>\n<p>bbb</p>" => FALSE,
+      ),
     );
     $this->assertFilteredString($filter, $tests);
 
