Support » Plugins » [Plugin: Linked] Missing space, fixed

  • Resolved Anthony D Paul

    (@anthonydpaul)


    I am using the Linked plugin by Skullbit that automatically adds hyperlinks to URLs.

    There is a glitch where a space before a URL is being dropped. I found the problem on lines 387, 395 and 399 of linked.php (version 1.0).

    preg_match is looking for a tag bracket (>) or a space (\s) to define the beginning of the URL string, then replacing the URL string with the formatted hyperlink, without a space (or tag bracket) in front.

    Simply adding a space before the returned hyperlink would work for some URLs, but in other cases, you’d get an extra space where you don’t want it.

    Instead, if you add $1 at the beginning of the returned string, you will add the space only in the case where a space was detected. Likewise, it will put that HTML end bracket (>) back where it belongs.

    In the end, these were the edits:

    Line 387

    From = '<a href="mailto:$2">$2</a>'
    To = '$1<a href="mailto:$2">$2</a>'

    Line 395

    From = '<a href="http://$2">$2</a>'
    To = '$1<a href="http://$2">$2</a>'

    Line 399

    From = '<a href="http://$2">$2</a>'
    To = '$1<a href="http://$2">$2</a>'

  • The topic ‘[Plugin: Linked] Missing space, fixed’ is closed to new replies.