Make WordPress Core

Ticket #5674: wpautop_obj.patch

File wpautop_obj.patch, 947 bytes (added by azaozz, 17 years ago)
  • formatting.php

     
    6767        $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
    6868        $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
    6969        $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
     70        if ( strpos($pee, '<object') !== false ) {
     71        $pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed
     72        $pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee);
     73        }
    7074        $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates
    7175        $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end
    7276        $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace