URL tag problem

Started by Sawyer, December 11, 2011, 11:54:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

whocares

There are no differences in the two things you posted. and the issue was more likely in the $bb_code_out array.
Unless stated otherwise code is untested

nicukent

Change this line:
$bb_code_in = array( '/\[b\]\s*((\s|.)+?)\s*\[\/b\]/i',
'/\[i\]\s*((\s|.)+?)\s*\[\/i\]/i',
'/\[u\]\s*((\s|.)+?)\s*\[\/u\]/i',
                '/\[url=(.+?)\](.*?)\[\/url\]/i',
'/\[url\](.*?)\[\/url\]/i',
'/\[email\](.*?)\[\/email\]/i',
'/\[align=([a-zA-Z]+)\]((\s|.)+?)\[\/align\]/i',
'/\[blockquote\]\s*((\s|.)+?)\s*\[\/blockquote\]/i',
'/\[strike\]\s*((\s|.)+?)\s*\[\/strike\]/i',
'/\[s\]\s*((\s|.)+?)\s*\[\/s\]/i',
'/\[pre\]\s*((\s|.)+?)\s*\[\/pre\]/i',
'/\[marquee\](.*?)\[\/marquee\]/i',
'/\[collapse=(.*?)\]\s*((\s|.)+?)\s*\[\/collapse\]/i',
'/\[size=([1-7])\]\s*((\s|.)+?)\s*\[\/size\]/i',
'/\[color=([a-zA-Z]+)\]\s*((\s|.)+?)\s*\[\/color\]/i',
'/\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\]\s*((\s|.)+?)\s*\[\/color\]/i',
'/\[font=([a-zA-Z ,]+)\]((\s|.)+?)\[\/font\]/i',
'/\[quote\]\s*((\s|.)+?)\s*\[\/quote\]/i',
'/\[quote=(.+?)\]\s*((\s|.)+?)\s*\[\/quote\]/i',
'/\[spoiler\]\s*((\s|.)+?)\s*\[\/spoiler\]/i',
'/\[video=[^\s\'"<>]*youtube.com.*v=([^\s\'"<>]+)\]/ims',
"/\[video=[^\s'\"<>]*video.google.com.*docid=(-?[0-9]+).*\]/ims",
'/\[audio\](http:\/\/[^\s\'"<>]+(\.(mp3|aiff|wav)))\[\/audio\]/i',
'/\[list=([0-9]+)\]((\s|.)+?)\[\/list\]/i',
'/\[list\]((\s|.)+?)\[\/list\]/i',
'/\[\*\]\s?(.*?)\n/i',
'/\[li\]\s?(.*?)\n/i',
'/\[hr\]/'
);


with this:

$bb_code_in = array( '/\[b\]\s*((\s|.)+?)\s*\[\/b\]/i',
'/\[i\]\s*((\s|.)+?)\s*\[\/i\]/i',
'/\[u\]\s*((\s|.)+?)\s*\[\/u\]/i',
                '/\[url=(.+?)\](.*?)\[\/url\]/i',
'/\[url\](.*?)\[\/url\]/i',
'/\[email\](.*?)\[\/email\]/i',
'/\[align=([a-zA-Z]+)\]((\s|.)+?)\[\/align\]/i',
'/\[blockquote\]\s*((\s|.)+?)\s*\[\/blockquote\]/i',
'/\[strike\]\s*((\s|.)+?)\s*\[\/strike\]/i',
'/\[s\]\s*((\s|.)+?)\s*\[\/s\]/i',
'/\[pre\]\s*((\s|.)+?)\s*\[\/pre\]/i',
'/\[marquee\](.*?)\[\/marquee\]/i',
'/\[collapse=(.*?)\]\s*((\s|.)+?)\s*\[\/collapse\]/i',
'/\[size=([1-7])\]\s*((\s|.)+?)\s*\[\/size\]/i',
'/\[color=([a-zA-Z]+)\]\s*((\s|.)+?)\s*\[\/color\]/i',
'/\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\]\s*((\s|.)+?)\s*\[\/color\]/i',
'/\[font=([a-zA-Z ,]+)\]((\s|.)+?)\[\/font\]/i',
'/\[quote\]\s*((\s|.)+?)\s*\[\/quote\]/i',
'/\[quote=(.+?)\]\s*((\s|.)+?)\s*\[\/quote\]/i',
'/\[spoiler\]\s*((\s|.)+?)\s*\[\/spoiler\]/i',
'/\[video=[^\s\'"<>]*youtube.com.*v=([^\s\'"<>]+)\]/ims',
"/\[video=[^\s'\"<>]*video.google.com.*docid=(-?[0-9]+).*\]/ims",
'/\[audio\](http:\/\/[^\s\'"<>]+(\.(mp3|aiff|wav)))\[\/audio\]/i',
'/\[list=([0-9]+)\]((\s|.)+?)\[\/list\]/i',
'/\[list\]((\s|.)+?)\[\/list\]/i',
'/\[\*\]\s?(.*?)\n/i',
'/\[li\]\s?(.*?)\n/i',
'/\[hr\]/'
);

Sawyer

I have a problem with url tag.
If for example is posted something like this:
Google Created a new topic [url=http://xxxxx.org/forums.php?action=view_topic&topic_id=1&page=last]Test[/url]If i click on Test, goes to http://xxxx.org/%5C%221%5C%22.

I use V2 Memcache.