WordPress.org

Make WordPress Core

Ticket #2813: 2813.patch

File 2813.patch, 716 bytes (added by pishmishy, 8 years ago)

Replaces match 0 or more with match 1 or more in regex

  • formatting.php

     
    8080        $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); 
    8181        if ($br) { 
    8282                $pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee); 
    83                 $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks 
     83                $pee = preg_replace('|(?<!<br />)\s+\n|', "<br />\n", $pee); // optionally make line breaks 
    8484                $pee = str_replace('<WPPreserveNewline />', "\n", $pee); 
    8585        } 
    8686        $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee);