Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autolink_email mangles URL if it contains 'mail' #23

Open
dlangille opened this issue Jan 13, 2023 · 0 comments
Open

autolink_email mangles URL if it contains 'mail' #23

dlangille opened this issue Jan 13, 2023 · 0 comments

Comments

@dlangille
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant