Forums / Cotonti / Support / Links are not working correct

links with a ":" or "-" do not work with bbcode

foxhound
#1 2010-07-13 19:43
I have a problem on my website. The bbcode for urls is not working correctly as how it should.
I checked it on this site and here it is working just fine as you can see below.
The problem is with links like these:
http://community.bistudio.com/wiki/ArmA2:_Moves
The ":" makes the bbcode being unable to paste the link correctly. If you use bbcodes the output looks like this:
- [url=http://community.bistudio.com/wiki/ArmA2:_Moves]Animation list 3[/url]
- [url]http://community.bistudio.com/wiki/ArmA2:_Moves[/url]
While if I post these links here they are pasted correctly:
- Animation list 3
- [url]http://community.bistudio.com/wiki/ArmA2:_Moves[/url] <----hmmm, seems not to work here neither?

You can have a look for yourself how it looks in the forums:
http://www.armaholic.com/forums.php?m=posts&q=6751


This is my bbcode:
\[url=((?:http://|https://|ftp://)?[^\s"':\[]+)\](.+?)\[/url\]
with html:
<a href="$1" target="_blank">$2</a>

And here is the other bbcode:
\[url\]((?:http://|https://|ftp://)?[^\s"':]+)\[/url\]
with html:
<a href="$1" target="_blank">$1</a>

Anyone able to see what is wrong?
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
ez
#2 2010-07-13 20:11
Hi fox,

[^\s"':\[]+)\](.+?)

is different from:

[^\s"':]+)

so the second one will detect less url's.

This is just a quick look at it, do not kill me if it is wrong..

But try to replace [^\s"':]+) with [^\s"':\[]+)\](.+?)

OW, when you change BBCodes, try it in a NEW post, or save an existing one.

greetings,

EZ

(ps. Check the shoutbox I sent :) )
==- I say: Keep it EZ -==
foxhound
#3 2010-08-14 20:09
Sorry for not responding for so long but I went out on holidays and also have my PC fried and so lost all details (inlcuding the main email, thats why i did not answer you yet, I had to wait for mail from my isp).

Anyway, changing the bbcode like that does not fix it, cause the first bbcode does not even work on my site neither. This
- Animation list 3
- [url]http://community.bistudio.com/wiki/ArmA2:_Moves[/url]

Displays as
- [url=http://community.bistudio.com/wiki/ArmA2:_Moves]Animation list 3[/url]
- [url]http://community.bistudio.com/wiki/ArmA2:_Moves[/url]

Here on the Cotonti site its working (that first link, the second is neither), so I am wondering whats wrong with my bbcode in the admin panel.
If you want to see an example i can show you on the site.
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
pieter
#4 2010-08-14 20:41
In your BBCode : is not aloud

\[url=((?:http://|https://|ftp://)?[^\s"':\[]+)\](.+?)\[/url\]

delete de : in de part after second ?

Like this:
\[url=((?:http://|https://|ftp://)?[^\s"'\[]+)\](.+?)\[/url\]
... can we help you ...
foxhound
#5 2010-08-14 21:49
Awesome, thanks a lot.
You know, probably this is again due to my stupidity but i always thought that list was the "allow" list :O

Thanks, that immediatly fixed all my link issues!
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
pieter
#6 2010-08-14 21:52
Do you have a gaming-site?

A lot of them have pictures with stats. And in there are also :
If you delete them there do, these can be shown too.
See here
... can we help you ...
foxhound
#7 2010-08-14 23:13
Yes, gaming community site.
Thanks for that I did read the topic earlier today and checked my code, all was fine there ;)
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />