WordPress.org

Make WordPress Core

Changeset 26974


Ignore:
Timestamp:
01/17/2014 09:31:59 AM (8 years ago)
Author:
nacin
Message:

make_clickable: When cleaning up accidental links within links, account for the tag being split by newlines.

props dd32.
fixes #19028.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r26972 r26974  
    17431743
    17441744    // Cleanup of accidental links within links
    1745     $r = preg_replace( '#(<a( [^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
     1745    $r = preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
    17461746    return $r;
    17471747}
  • trunk/tests/phpunit/tests/formatting/MakeClickable.php

    r26094 r26974  
    381381        }
    382382    }
     383
     384    /**
     385     * @ticket 19028
     386     */
     387    function test_line_break_in_existing_clickable_link() {
     388        $html = "<a
     389                  href='mailto:someone@example.com'>someone@example.com</a>";
     390        $this->assertEquals( $html, make_clickable( $html ) );
     391    }
    383392}
Note: See TracChangeset for help on using the changeset viewer.