WordPress.org

Make WordPress Core

Ticket #23050: fix.make.clickable.23050.diff

File fix.make.clickable.23050.diff, 470 bytes (added by mikejolley, 8 years ago)

Fix for the code which removes links within links

  • wp-includes/formatting.php

    diff --git wp-includes/formatting.php wp-includes/formatting.php
    index 904c99b..e80a23c 100644
    function make_clickable( $text ) { 
    16461646        }
    16471647
    16481648        // Cleanup of accidental links within links
    1649         $r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
     1649        $r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a>([^<]+?)</a>#i', "$1$3$4</a>", $r );
    16501650        return $r;
    16511651}
    16521652