Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorithcy
    • CommentTimeJul 18th 2005 edited
     # 1
    i noticed that (as of v0.9.1) the autolink function doesn't always work correctly.
    (//see below)

    the fix is in line 55 of library/Utility.StringManipulator.class.php:

    it reads return preg_replace("/(?<!<a href=\")(?<!\")(?<!\">)((http|https|ftp):\/\/[\w?=&.\/-]+)/","<a href=\"\\1\" target=\"_blank\">\\1</a>",$String)

    and should read return preg_replace("/(?&lt;!&lt;a href=\")(?&lt;!\")(?&lt;!\">)((http|https|ftp):\/\/[\w?=&.\/-<span style="color:red">;#</span>]+)/","&lt;a href=\"\\1\" target=\"_blank\">\\1&lt;/a>",$String);

    there are probably more valid URL characters that could be added to that character class, but this fixes at least most links that point to vanilla discussions.
    • CommentAuthorithcy
    • CommentTimeJul 18th 2005 edited
     # 2
    •  
      CommentAuthorMark
    • CommentTimeJul 18th 2005
     # 3
    Sweet - thanks for the tip - I'll add that to the next rev :)
    •  
      CommentAuthorMark
    • CommentTimeJul 18th 2005
     # 4
    Okay - I implemented it here. I also added a tilde...

    http://lussumo.com/community/comments.php?DiscussionID=311~Item_2
    • CommentAuthorithcy
    • CommentTimeJul 18th 2005 edited
     # 5
    yay :) and yeah, good one
    • CommentAuthorithcy
    • CommentTimeJul 18th 2005 edited
     # 6
    there is a weirdness with ampersands as well... let me see

    http://lussumo.com/community/comments.php?DiscussionID=311&page=1#Item_6%20test

    // it's not doing it now. when i entered those examples above, the autolink added an extra ; before page=1. i had to fudge them. did you fix that?
    •  
      CommentAuthorMark
    • CommentTimeJul 18th 2005
     # 7
    No, I didn't. that's wierd. That sounds like a parameters class problem (not that you know what that means). Do you remember where you went to copy the link?
    • CommentAuthorithcy
    • CommentTimeJul 18th 2005
     # 8
    i want to say it was the thread title on the front page, but the ; didn't appear in the textbox. only when the comment was rendered.
    • CommentAuthorithcy
    • CommentTimeJul 18th 2005
     # 9
    doh, you might to add % as well - i missed the obvious ones
    •  
      CommentAuthorMark
    • CommentTimeJul 18th 2005
     # 10
    typo maybe?

    I just know that the parameters class (which builds querystring parameters) truncates the final & off the end of the string. i was thinking that maybe it didn't truncate properly under some particular circumstance and only got the & and not the ;

    Anyway - yeah, I'll add the %
    • CommentAuthorithcy
    • CommentTimeJul 19th 2005
     # 11
    hmm... might have been a typo, but i'm sure i just copied & pasted. anyway it works now. thanks nav! you rule.
Add your comments
    Username Password
  • Format comments as