bbcode hyperlink issue

Posted by Jorm on Stack Overflow See other posts from Stack Overflow or by Jorm
Published on 2010-04-11T08:45:35Z Indexed on 2010/04/11 8:53 UTC
Read the original article Hit count: 583

Filed under:
|

I'm having an annoying :)

I use regexes from this: http://forums.codecharge.com/posts.php?post_id=77123

if you enter [url]www.bob.com[/url] it leads too http://localhost/test/www.bobsbar.com

So I added before http://$1 in the replacement. That fix it but then [url]http://www.bob.com[/url] will lead to http://http://www.bobsbar.com

How would you fix this? I want my users to be able to post links with AND without http:// and i want it to redirect to the site -_-

Hope you understand this.

Jorm

© Stack Overflow or respective owner

Related posts about php

Related posts about bbcode