UBB.Dev
Posted By: Xiphoid Editing Converts UBB Code to HTML - 04/21/2003 5:17 AM
After installing dozens of hacks, I'm afraid that I've come across a problem that I don't know how to back-track on. The problem is that when a member edits his or her post, any UBB code that is contained in the post is converted to HTML. This would be okay if I had HTML turned on, but I don't due to security reasons.

Does anyone know the area (or line would be preferable) where this is handled in the code? Thanks a ton. smile
Posted By: PrimeTime Re: Editing Converts UBB Code to HTML - 04/21/2003 6:39 AM
The only way I was able to resolve this was to eliminate all tags and adjoining HTML codes in the UBB code routines for the ubb_lib.cgi and ubb_lib_posting.cgi files. I haven't come across or know of any other method to get around the return routines. smile The trick is the make certain that whatever you edit in one file it must match the other or you'll get the HTML raw codes when editing. smile
Posted By: Charles Capps Re: Editing Converts UBB Code to HTML - 04/21/2003 7:47 AM
Is the HTML there as the user edits the post, i.e. the textarea contains the HTML, or does the edited post come out as HTML? If it's the former, prep_for_edit is failing... otherwise, it's the bake_post or cook_post call failing.
Posted By: PrimeTime Re: Editing Converts UBB Code to HTML - 04/21/2003 8:08 AM
I'm guessing both since the edited post and text area displays HTML raw code (e.g., smile

I found myself having to edit "sub reverse_ubb_code" and "sub ProcessCodeTag" for ubb_lib_posting.cgi. For ubb_lib.cgi I edited "sub UBBCode_core". After doing so the problem was resolved. smile
Posted By: Xiphoid Re: Editing Converts UBB Code to HTML - 04/21/2003 9:12 AM
Charles, both are occurring.

Is this problem standard in all UBBs?

Thanks for the suggestion, Prime. I'll give it a try tomorrow and let you know how it works. smile
Posted By: CTM Re: Editing Converts UBB Code to HTML - 04/21/2003 1:04 PM
The problem generally occurs when you install a modification that edits any of these subs. I'm putting my money on Advanced UBB Code here... If you have it installed, whose version of the hack did you use?
Posted By: Xiphoid Re: Editing Converts UBB Code to HTML - 04/21/2003 6:36 PM
I used this one by Risperdal.

I'm assuming it won't hurt the usability of anything if I were to delete the HTML tags out of those sub procedures as Prime suggested?
Posted By: PrimeTime Re: Editing Converts UBB Code to HTML - 04/22/2003 5:49 AM
Quote
quote:
Originally posted by CTM:
The problem generally occurs when you install a modification that edits any of these subs. I'm putting my money on Advanced UBB Code here
Maybe, but then again on a default UBB this issue can occur. smile I don't use the UBB Advanced Codes and I still get the HTML raw codes. I initially thought it was due to the "Preventing Double Quote hack" but that wasn't the case. smile
Posted By: PrimeTime Re: Editing Converts UBB Code to HTML - 04/22/2003 5:55 AM
Quote
quote:
Originally posted by Xiphoid:

I'm assuming it won't hurt the usability of anything if I were to delete the HTML tags out of those sub procedures as Prime suggested?
I've been doing it since 6.2.1 and never experienced any problems because of it. smile

It takes a bit of work since you need to edit quite a bit in both "ubb_lib_posting.cgi", "ubb_lib.cgi" and maybe in "ubb_new_reply.cgi" (if using Quick Reply) files. Back up any files you edit however since it may take a bit of trial and error. smile
Posted By: Xiphoid Re: Editing Converts UBB Code to HTML - 04/22/2003 7:05 PM
Quote
quote:
The trick is the make certain that whatever you edit in one file it must match the other or you'll get the HTML raw codes when editing.
So I can copy the lines from ubb_lib over the ones in ubb_lib_posting (I think they're the ones that are messed up)?

I tried deleting all of the HTML stuff I saw but received an error... I probably deleted too much or too little.
Posted By: PrimeTime Re: Editing Converts UBB Code to HTML - 04/23/2003 2:16 AM
I could be wrong but I don't think you can copy from one file to the other. You'll have to manually edit both files.

Here is an example to what I did:

Original code from UBB 6.4 in ubb_lib_posting.cgi:

Code
[/code]HTML edit:

[code]
That is just for the "old quote/code". I did this to basically every UBB Code...Only taking out the "font" tags and other codes I didn't need. laugh It's quite an extensive solution but it works. smile
© UBB.Developers