Make WordPress Core

Ticket #29314: wp-functions.php.patch

File wp-functions.php.patch, 852 bytes (added by hauvong, 11 years ago)

Patch to fix link containing "?" and issue extracting url from shortcode tags: [shortcode attr="http://.."]http:...[/shortcode]

  • wp-includes/functions.php

     
    457457 */
    458458function wp_extract_urls( $content ) {
    459459        preg_match_all(
    460                 "#("
     460                "#([\"']?)("
    461461                        . "(?:([\w-]+:)?//?)"
    462462                        . "[^\s()<>]+"
    463463                        . "[.]"
     
    464464                        . "(?:"
    465465                                . "\([\w\d]+\)|"
    466466                                . "(?:"
    467                                         . "[^`!()\[\]{};:'\".,<>?«»“”‘’\s]|"
     467                                        . "[^`!()\[\]{};:'\".,<>«»“”‘’\s]|"
    468468                                        . "(?:[:]\d+)?/?"
    469469                                . ")+"
    470470                        . ")"
    471                 . ")#",
     471                . ")\\1#",
    472472                $content,
    473473                $post_links
    474474        );
    475475
    476         $post_links = array_unique( array_map( 'html_entity_decode', $post_links[0] ) );
     476        $post_links = array_unique( array_map( 'html_entity_decode', $post_links[2] ) );
    477477
    478478        return array_values( $post_links );
    479479}