Skip to content

autolink_email mangles URL if it contains 'mail' #23

Open
@dlangille

Description

@dlangille

When the URL contains 'email', the mailto isn't seeing that it's already in a tag.

% cat test.php
<?php

include('lib_autolink.php');

$html = "http://this.is.link/[email protected]&[email protected]&x=1";

$html = autolink($html,0);

echo $html . "\n";

$html = autolink_email($html);

echo $html . "\n";

The output is:

% php test.php
<a href="http://this.is.link/[email protected]&amp;[email protected]&amp;x=1">this.is.link/[email protected]&amp;[email protected]&amp;x=1</a>
<a href="http://this.is.link/[email protected]&amp;<a href="mailto:[email protected]&amp">[email protected]&amp</a>;x=1"><a href="mailto:this.is.link/[email protected]&amp">this.is.link/[email protected]&amp</a>;<a href="mailto:[email protected]&amp">[email protected]&amp</a>;x=1</a>

When I expected the second line to be the same as the first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions