Customizing SMF > SMF Coding Discussion
exception in sanitize_bbc
ibtkm:
Am I right that the work of sanitize_bbc is applying the bbc codes? for example applying the color , ...
If yes, Is there anyway to make a special bbc code an exception? For example I just wanna restrict size bbc code for profile status And I was trying to find a way to restrict in sanitize_bbc
Is there anyway to do that?
tnx
Arantor:
You're partially right, it's for sanitising bbc, but it's not for the purpose you're thinking of. It is in fact for other specific uses (namely HTML to BBC conversion)
Instead, look in preparsecode() where all proper sanitisation can be applied, specifically where it excludes the html bbc for non admins. Something similar may be possible but without knowing exactly what you're trying to do (since you've been a bit vague) it's hard to give you any more specific advise.
ibtkm:
I wanna restrict using "font" bbc code ( [font] [/font) in profile statuses. Not in whole of the forum
Arantor:
Profile statuses? Is that a mod? If so, you're best bugging the author of the mod (there are ways they can deal with it, likely better, than writing an exception in the preparser, especially because there is no way to know from actually inside the preparser that it's being called on profile statuses)
ibtkm:
I did sth funny :D
I copied parse_bbc function again with the name "parse_bbc_e" and the section of it that is dedicated to defining tag array, I replaced the <span font-size=xxx> with <span> :D
by using parse_bbc_e instead of parse_bbc it works :) size tag won't work
Navigation
[0] Message Index
[#] Next page
Go to full version