Print Page | Close Window

Bug and fix for non RTE WWF

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=30113
Printed Date: 31 March 2026 at 9:29pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Bug and fix for non RTE WWF
Posted By: Gullanian
Subject: Bug and fix for non RTE WWF
Date Posted: 14 January 2012 at 12:12am
If you enter a URL as:

    url] http://www.scirra.com[/url

It renders as:

%20http://www.scirra.com" rel="nofollow - Make games

It doesn't render a valid URL. (Note the space char before URL)  In the format post functions I've changed it to render URLs with regex and it fixes this issue:

    Dim regEx
    Set regEx = New RegExp

    With regEx
        .Pattern = "\[url\]\s*([^\]]+)\s*\[\/url\]"
        .IgnoreCase = True
        .Global = True
    End With
    strMessage = regEx.Replace(strMessage, "<a href=""$1"">$1</a>")

    With regEx
        .Pattern = "\[url=\s*([^\]]+)\s*\]\s*([^\]]+)\s*\[\/url\]"
        .IgnoreCase = True
        .Global = True
    End With
    strMessage = regEx.Replace(strMessage, "<a href=""$1"">$2</a>")

    Set regEx = nothing

Only a small bug but my server emails me 404's, and for some reason a lot of my users seem to be posting urls which render with %20 infront of them



Replies:
Posted By: WebWiz-Bruce
Date Posted: 16 January 2012 at 1:24pm
Thanks Gullanian.

Really should look at using Regular Expressions for all the BBcodes.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Gullanian
Date Posted: 20 January 2012 at 2:10am
Yeah RegEx should make it more concise.  I'm thinking about spending some time soon updating the non-rte formatting functions because there's a few more small problems as well, if I get round to it I will post it in here.  It's hard to write some of the things I want to do though because Classic ASP doesn't have things like negative lookbehinds



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net