WordPress.org

Make WordPress Core

Ticket #31695: patch.diff

File patch.diff, 638 bytes (added by vaurdan, 6 years ago)

Diff file with the patch

  • wp-includes/formatting.php

     
    411411                $pee = preg_replace( '|</option>\s*|', '</option>', $pee );
    412412        }
    413413
     414        if ( strpos( $pee, '<script' ) !== false ) {
     415                // no P/BR around script
     416                $pee = preg_replace( '|\s*<script|', '<script', $pee );
     417                $pee = preg_replace( '|</script>\s*|', '</script>', $pee );
     418        }
     419
    414420        if ( strpos( $pee, '</object>' ) !== false ) {
    415421                // no P/BR around param and embed
    416422                $pee = preg_replace( '|(<object[^>]*>)\s*|', '$1', $pee );