Web Wiz

  New Posts New Posts RSS Feed - Add more ways to write URLs in (U)BBcode
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Add more ways to write URLs in (U)BBcode

 Post Reply Post Reply
Author
Jagoop View Drop Down
Groupie
Groupie
Avatar

Joined: 17 August 2009
Location: Denmark
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jagoop Quote  Post ReplyReply Direct Link To This Post Topic: Add more ways to write URLs in (U)BBcode
    Posted: 16 January 2014 at 10:02pm
Web Wiz Forum version 10.17 recognizes the following way of writing an URL in (U)BBcode:

[URL=http://www.google.com/][/URL]


But it does not support the other common way of writing an URL (with "):

[URL="http://www.google.com/"][/URL]


I would suggest updating the RegExp in functions_format_post.asp from:

\[URL=\s*([^\]]+)\s*\]\s*([^\]]+)\s*\[\/URL\]

To:

\[URL=\s*"?([^\]]+)"?\s*\]\s*([^\]]+)\s*\[\/URL\]

In order to support both ways of writing URLs.
Back to Top
Jagoop View Drop Down
Groupie
Groupie
Avatar

Joined: 17 August 2009
Location: Denmark
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jagoop Quote  Post ReplyReply Direct Link To This Post Posted: 16 January 2014 at 10:24pm
I just played around with the RegExp a bit more, and came up with a better solution:

        .Pattern = "\[URL=\s*\s*""?\s*([^\]]+)\s*""?\s*\s*\]\s*([^\]]+)\s*\[\/URL\]"

This pattern also handles the (in my experience) rather common issue with users copying an URL and accidentally include one or more whitespace characters before or after the URL.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Poole
Status: Offline
Points: 9487
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2014 at 8:43am
Thanks Jagoop, will look at adding this in the next release.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.01
Copyright ©2001-2018 Web Wiz Ltd.


Become a Fan on Facebook Follow us on Twitter Find us on Google+ Community Forums Web Wiz Blogs Web Wiz News
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, United Kingdom.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2018 Web Wiz Ltd. All rights reserved.