Make WordPress Core

Ticket #33106: 33106-idea.patch

File 33106-idea.patch, 1.2 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                . '(?:'         // Unroll the loop: Consume everything until ]]> is found.
     620                .     '](?!]>)' // One ] not followed by end of comment.
     621                .     '[^\]]*+' // Consume non-].
     622                . ')*+'         // Loop possessively.
     623                . '(?:]]>)?';   // End of comment. If not found, match all input.
     624
    617625        $regex =
    618626                  '/('              // Capture the entire match.
    619627                .     '<'           // Find start of element.
     
    620628                .     '(?(?=!--)'   // Is this a comment?
    621629                .         $comments // Find end of comment.
    622630                .     '|'
    623                 .         '[^>]*>?' // Find end of element. If not found, match all input.
     631                .         '(?(?=!\[CDATA\[)' // Is this a comment?
     632                .             $cdata // Find end of comment.
     633                .         '|'
     634                .             '[^>]*>?' // Find end of element. If not found, match all input.
     635                .         ')'
    624636                .     ')'
    625637                . ')/s';
    626638