Make WordPress Core

Ticket #33106: 33106.patch

File 33106.patch, 1.3 KB (added by miqrogroove, 10 years ago)
  • src/wp-includes/formatting.php

     
    614614                . ')*+'         // Loop possessively.
    615615                . '(?:-->)?';   // End of comment. If not found, match all input.
    616616
     617        $cdata =
     618                  '!\[CDATA\['  // Start of comment, after the <.
     619                . '[^\]]*+'     // Consume non-].
     620                . '(?:'         // Unroll the loop: Consume everything until ]]> is found.
     621                .     '](?!]>)' // One ] not followed by end of comment.
     622                .     '[^\]]*+' // Consume non-].
     623                . ')*+'         // Loop possessively.
     624                . '(?:]]>)?';   // End of comment. If not found, match all input.
     625
    617626        $regex =
    618627                  '/('              // Capture the entire match.
    619628                .     '<'           // Find start of element.
     
    620629                .     '(?(?=!--)'   // Is this a comment?
    621630                .         $comments // Find end of comment.
    622631                .     '|'
    623                 .         '[^>]*>?' // Find end of element. If not found, match all input.
     632                .         '(?(?=!\[CDATA\[)' // Is this a comment?
     633                .             $cdata // Find end of comment.
     634                .         '|'
     635                .             '[^>]*>?' // Find end of element. If not found, match all input.
     636                .         ')'
    624637                .     ')'
    625638                . ')/s';
    626639