Make WordPress Core

Ticket #60814: 60814.patch

File 60814.patch, 2.4 KB (added by shailu25, 2 years ago)

Patch Added

  • src/wp-includes/formatting.php

    diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
    index a756f6d12a..77c772001c 100644
    a b function _make_url_clickable_cb( $matches ) { 
    29462946
    29472947        if ( ')' === $matches[3] && strpos( $url, '(' ) ) {
    29482948                /*
    2949                  * If the trailing character is a closing parethesis, and the URL has an opening parenthesis in it,
     2949                 * If the trailing character is a closing parenthesis, and the URL has an opening parenthesis in it,
    29502950                 * add the closing parenthesis to the URL. Then we can let the parenthesis balancer do its thing below.
    29512951                 */
    29522952                $url   .= $matches[3];
    function make_clickable( $text ) { 
    31053105                // Long strings might contain expensive edge cases...
    31063106                if ( 10000 < strlen( $piece ) ) {
    31073107                        // ...break it up.
    3108                         foreach ( _split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses.
     3108                        foreach ( _split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing parentheses.
    31093109                                if ( 2101 < strlen( $chunk ) ) {
    31103110                                        $r .= $chunk; // Too big, no whitespace: bail.
    31113111                                } else {
    function make_clickable( $text ) { 
    31213121                                        [\\w]{1,20}+://                                # Scheme and hier-part prefix.
    31223122                                        (?=\S{1,2000}\s)                               # Limit to URLs less than about 2000 characters long.
    31233123                                        [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]*+         # Non-punctuation URL character.
    3124                                         (?:                                            # Unroll the Loop: Only allow puctuation URL character if followed by a non-punctuation URL character.
     3124                                        (?:                                            # Unroll the Loop: Only allow punctuation URL character if followed by a non-punctuation URL character.
    31253125                                                [\'.,;:!?)]                                    # Punctuation URL character.
    31263126                                                [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]++         # Non-punctuation URL character.
    31273127                                        )*
    31283128                                )
    3129                                 (\)?)                                          # 3: Trailing closing parenthesis (for parethesis balancing post processing).
     3129                                (\)?)                                          # 3: Trailing closing parenthesis (for parenthesis balancing post processing).
    31303130                        ~xS';
    31313131                        /*
    31323132                         * The regex is a non-anchored pattern and does not have a single fixed starting character.