Legacy Strip img code from the thread preview

Status
Not open for further replies.
This suggestion has been closed. Votes are no longer accepted.
All bbcodes should currently be getting stripped out of the preview. Are you seeing otherwise?

Brad via Tapatalk
 
The current way it strips bbcode is just a default vB function. I will look into it if I can define specific bbcodes to strip completely. Originally, I had it strip the contents inside any bbcode tags, but that really screwed up the contents, as words that were bold/italics, or mentions, or any other text inside the bbcode was completely removed.
 
Here is some code I'm using to deal with a similar situation with my thread previews:

PHP:
// Replace Links - Long links leave us with messed up tables
					        $links_find = array(
					        '`((?:https?|ftp)://\S+[[:alnum:]]/?)`si',
					        '`((?<!//)(www\.\S+[[:alnum:]]/?))`si'
					        );
					        $links_replace = array(
					        '',
					        ''
					        );


$thread['preview'] = preg_replace($links_find,$links_replace,$thread['preview']);


...I'm not a coder, but I stayed at a holiday inn express last night ;)
 
Status
Not open for further replies.
Top