WordPress.org

Make WordPress Core

Ticket #26868: 26868.patch

File 26868.patch, 1.0 KB (added by jbkkd, 6 years ago)

This makes the trailing optional. This is by no means a full solution, as it would allow http:example.com, but works as a good workaround to allow mailto: and friends, while still maintaining the same functionality

  • src/wp-includes/formatting.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    17191719                        $url_clickable = '~
    17201720                                ([\\s(<.,;:!?])                                        # 1: Leading whitespace, or punctuation
    17211721                                (                                                      # 2: URL
    1722                                         [\\w]{1,20}+://                                # Scheme and hier-part prefix
     1722                                        [\\w]{1,20}+:/*                                # Scheme and hier-part prefix
    17231723                                        (?=\S{1,2000}\s)                               # Limit to URLs less than about 2000 characters long
    17241724                                        [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]*+         # Non-punctuation URL character
    17251725                                        (?:                                            # Unroll the Loop: Only allow puctuation URL character if followed by a non-punctuation URL character