•  
      request #1664 Links not clickables in Forum ML
    Infos
    #1664
    Martin GOYOT (goyotm)
    2021-05-29 14:43
    2012-10-23 15:11
    1767
    Details
    Links not clickables in Forum ML
    When posting a link in a ForumML Discussion, links aren't clickable.
    Mailing lists
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2021-05-29
    Attachments
    Empty
    References
    References list is empty

    Follow-ups

    User avatar

    After some tests, links seem to be clickable. Closing.


    • Status changed from Verified to Closed
    • Close date set to 2021-05-29
    User avatar

    Hi,

    There is an existing method to convert links in a text.

        $hp = Codendi_HTMLPurifier::instance();
        $text_with_links = $hp->purify($text, CODENDI_PURIFIER_BASIC);
    

    Note: It also prunes potential XSS vulnerabilities

    Since I cannot test the same in my localhost to detect the same as this functionality can't be replicated in localhost

    Developers MUST ensure that the contribution they submit effectively fix the bug. You have to configure your development environment to be able to fully test the functionality.

    Thanks,
    Nicolas Terray


    • Platform set to
    • Is an Enhancement or an internal improvement? set to
    User avatar
    Biswajit Das (Biswajit)2012-12-10 08:57
    Hi,

    For fixing this bug, i need to embed the below code in my earlier post inside /plugins/forumml/www/message.php file. For that, Can anyone please let me know inside which variable is the discussion content body stored, so that I can pass that content to my function to convert the links to clickable.

    Since I cannot test the same in my localhost to detect the same as this functionality can't be replicated in localhost
    User avatar
    Biswajit Das (Biswajit)2012-12-07 19:54
    The following code snippet converts the links to clickable present in any sentence say $text

    $text = trim($text);
    while ($text != stripslashes($text)) { $text = stripslashes($text); }
    $text = strip_tags($text,"<b><i><u>");
    $text = preg_replace("/(?<!http:\/\/)www\./","http://www.",$text);
    $text = preg_replace( "/((http|ftp)+(s)?:\/\/[^<>\s]+)/i", "<a href=\"\\0\" target=\"_blank\">\\0</a>",$text);

    The posts in the discussion can be made to pass through this snippet, by passing the contents inside $text variable and it should work.