View Full Version : Problem with BBcode Removal
SS9267547
12-04-2006, 11:22 PM
I was hoping someone could shed some light on a problem I'm having with my glossary script I'm working on. Now the problem is that I have information being accessed from a function and once that information is accessed and found it is to display the results in the script itself. Now the results is not to show any bbcode, html, quotes, etc. This is the code I want to use in the function.
$glossarydescription = htmlspecialchars_uni(strip_bbcode(fetch_trimmed_ti tle(strip_quotes($foundterms['glossarydescription']), 100), false, true));
Now the result is that only half the bbcode is removed, for example the formatting tags like '[b]' but none of the tags like ', [code]', etc as well as smiles are removed. I've also tried it like this too.
[PHP]
$glossarydescription = strip_tags($foundterms['glossarydescription']);
$glossarydescription = strip_bbcode($foundterms['glossarydescription'], false, true);
$glossarydescription = strip_strip_quotes($foundterms['glossarydescription']);
However again only half the bbcodes and quotes are removed. Everything else still loads. Any ideas that someone might have on the issue?
SS9267547
12-07-2006, 01:13 AM
So no one here at all has a clue? Ah I need to learn some better programming haha.
StarBuG
12-11-2006, 06:20 AM
Come on, help this man.
We are all eagerly awaiting the new version of his hack. ;)
It is this one by the way: https://vborg.vbsupport.ru/showthread.php?p=1136110
StarBuG
RS_Jelle
12-12-2006, 12:34 PM
To strip BBCode you need to include /includes/functions.php in your script, I think you are forgetting that :)
The options of the function:
$stripped = strip_bbcode($oldcode, $stripquotes = false, $fast_and_dirty = false, $showlinks = false);
Don't set fast_and_dirty to true, that's not a very good thing (everyting with is stripped).
SS9267547
12-13-2006, 03:37 AM
StarBuG: There will be no update ever again! ;)
RS_Jelle: Thanks for the reply on the issue however it dosn't help to much. See normally I'm able to strip info, I know how to do this however in the function where I want it there is a werid problem. The result it shows is only half the bbcode being removed, for example the formatting tags like '[b]' but none of the tags like '[php], [code]', etc and even smiles aren't removed. This is the issue at hand, so I think I will need to figure something else to try. :tired:
timetunnel
12-15-2006, 09:10 PM
Hello.
Is there a central location e.g. 'class_bbcode.php' or hook whereby a particular tag (custom or otherwise) and its contents can be stripped globally (across all features e.g. calendar, forums, pm, signatures, etc.)? If so, how?
Thanks in advance.
SS9267547
12-15-2006, 10:38 PM
Well I'm not sure what you want to strip, but the code used to srtip bbcode is in the 'functions.php' file under 'function strip_bbcode'. There are also other 'strip' commands in this file.
timetunnel
12-15-2006, 11:21 PM
Thanks for your reply.
I want to create a custom tag but only want to use it under varying conditions. For example, it may be by usergroup or after a member reaches a certain number of posts, etc.
If I knew 1 location where I can 'unset' that custom tag from the $tag_list array based on one or both conditions previously mentioned, or find that function that nearly all message code regardless of the application (forum, pm, etc.) and strip out that custom tag, then that would be a great help.
Thanks again, in advance.
EDIT: Answer: http://www.vbulletin.com/forum/showthread.php?t=152002
RS_Jelle
12-20-2006, 12:20 PM
RS_Jelle: Thanks for the reply on the issue however it dosn't help to much. See normally I'm able to strip info, I know how to do this however in the function where I want it there is a werid problem. The result it shows is only half the bbcode being removed, for example the formatting tags like '[b]' but none of the tags like '[php], [code]', etc and even smiles aren't removed. This is the issue at hand, so I think I will need to figure something else to try. :tired:
I always want to take a look at it on my test site if you send me the files, there should be something else, cause it should work fine normally :)
StarBuG
12-21-2006, 05:39 PM
I have talked to Andreas, a vBulletin developer.
He said you should try:
$glossarydescription = htmlspecialchars_uni(fetch_trimmed_title(strip_bbc ode($foundterms['glossarydescription'], true), 100);
(No warranty)
I also send this as PM to you but got no response ;)
Greetings
StarBuG
SS9267547
12-21-2006, 11:51 PM
RS_Jelle: I'll let you know when I'm working on it for version 1.2.2.
StarBuG: Thanks. I'll test it out and let you know.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.