WordPress.org

Make WordPress Core

Ticket #31695: patch-truck.diff

File patch-truck.diff, 649 bytes (added by vaurdan, 6 years ago)
  • src/wp-includes/formatting.php

     
    416416                $pee = preg_replace( '|</option>\s*|', '</option>', $pee );
    417417        }
    418418
     419        if ( strpos( $pee, '<script' ) !== false ) {
     420                // no P/BR around script
     421                $pee = preg_replace( '|\s*<script|', '<script', $pee );
     422                $pee = preg_replace( '|</script>\s*|', '</script>', $pee );
     423        }
     424
    419425        if ( strpos( $pee, '</object>' ) !== false ) {
    420426                // no P/BR around param and embed
    421427                $pee = preg_replace( '|(<object[^>]*>)\s*|', '$1', $pee );