Support » Plugins and Hacks » Tweeple » Email address not correctly displayed fix

  • Resolved sabinevi

    (@sabinevi)


    If a tweet contains an email address it doesn’t get correctly displayed. See tweet https://twitter.com/meerdangewenst/status/529222126176583680
    The e-mail address gets this markup once parsed by Tweeple:

    <a href="mailto://speeddate<a class="twitter-link" href="http://twitter.com/meerdangewenst" target="_blank">@meerdangewenst</a>.nl" class="twitter-link">speeddate<a class="twitter-link" href="http://twitter.com/meerdangewenst" target="_blank">@meerdangewenst</a>.nl</a>

    I found out why this happens: in the /tweeple/inc/functions.php on line 82, the email address gets a mailto-link but on line 88 the regex searches again for an @-sign and the email address gets formatted again as a linked Twitter username.

    To fix this you should add a caret (^) on line 88 between the first forward slash and the @-sign so the regex will only find strings that start with an @-sign:

    $text = preg_replace("/^@(\w+)/", "<a class=\"twitter-link\" href=\"http://twitter.com/\\1\" target=\"_blank\">@\\1</a>", $text);

    I also removed the two forward slashes on line 82 following ‘mailto:’ because I think they shouldn’t be there.

    https://wordpress.org/plugins/tweeple/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Email address not correctly displayed fix’ is closed to new replies.