Make WordPress Core


Ignore:
Timestamp:
09/08/2015 10:54:08 PM (11 years ago)
Author:
azaozz
Message:

Formatting: maintain the content of HTML comments when they contain <object> tags. Add more tests for wpaitop().

Props miqrogroove.
Fixes #33645 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r33923 r33955  
    497497
    498498        // Add a single line break above block-level opening tags.
    499         $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
     499        $pee = preg_replace('!(<' . $allblocks . '[\s/>])!', "\n$1", $pee);
    500500
    501501        // Add a double line break below block-level closing tags.
    … …  
    597597
    598598        // Restore newlines in all elements.
    599         $pee = str_replace( " <!-- wpnl --> ", "\n", $pee );
     599        if ( false !== strpos( $pee, '<!-- wpnl -->' ) ) {
     600                $pee = str_replace( array( ' <!-- wpnl --> ', '<!-- wpnl -->' ), "\n", $pee );
     601        }
    600602
    601603        return $pee;
Note: See TracChangeset for help on using the changeset viewer.