PDA

View Full Version : Feedback?



CornedBee
12-27-2003, 01:40 PM
Is there a feedback board? I don't see one.

I have an issue with the board. There seems to be an input validator to prevent people from posting code outside code tags. In particular, this code:

if((theform.message.value.indexOf("}") != -1 || theform.message.value.indexOf("{") != -1) && (theform.message.value.indexOf("
") == -1 && theform.message.value.indexOf("[CODE]") == -1 && theform.message.value.indexOf("[PHP]") == -1 && theform.message.value.indexOf("[php]") == -1))
{
alert("Please use code tags -- use the "Insert Source Code" button or use [code] and -- to post code containing indentation ({ and })");
return false;
}

But it is broken. It means for example that I can't write any post that contains the C character literal '}' without having a code tag section too.

Maybe a better solution can be found?

Salem
12-31-2003, 09:17 AM
> But it is broken. It means for example that I can't write any post that contains the C character literal '}'
Yeah, that's deliberate.

You can if you type in } which will show up as } (for anyone who knows their ASCII table and the HTML escapes).

It was felt at the time that braces outside of code were sufficiently rare in normal prose, and sufficiently common in code to use it as the deciding factor.

We were getting fed up with noobs posting code without using code tags that we implemented a system to detect code without tags. Yet despite this, occasional creative noobs seem to manage to post code without tags.

> Maybe a better solution can be found?
Feel free to suggest a better algorithm which says 'this is code' without generating false hits and misses.

Prelude
12-31-2003, 09:26 AM
>occasional creative noobs seem to manage to post code without tags.
And naturally the extra protection still doesn't stop many noobs from posting code with either no formatting, or awful formatting. Perhaps we should require everyone that registers to go through a mandatory tutorial on how to consistently format readable code.

>It means for example that I can't write any post that contains the C character literal '&#125' without having a code tag section too.
God forbid you use the proper name for the character when writing plain text instead of the character itself. Sure, it takes more typing, but readers will think "Wow, that person must be smart to know what &#125 is called". :)

CornedBee
12-31-2003, 11:44 AM
That particular situation warranted me writing the closing brace as if it was a C character literal.

Salem, thanks for the idea. I tend to forget that entities still work here.

axon
12-31-2003, 12:41 PM
Originally posted by Prelude

And naturally the extra protection still doesn't stop many noobs from posting code with either no formatting, or awful formatting. Perhaps we should require everyone that registers to go through a mandatory tutorial on how to consistently format readable code.


I agree.....this could be a good thing to teach new members and weed out. I persoanlly know a few people that if there is some extra thing to do they would not join...and we don't want these kind of people on our board :)

Waldo2k2
12-31-2003, 01:27 PM
echo axon, mods should bring this up with the webmaster

Hammer
01-01-2004, 05:37 AM
>>require everyone that registers to go through a mandatory tutorial<<
... to which people would simply hit the "next" button until they got to the end of the lesson. No-one (virtually anyway) will actually read it. That's imho.

Maybe the validation code should check for the existance of both an opening AND a closing brace. It's not much better, I know.

golfinguy4
01-01-2004, 11:52 AM
There are ways to do it. You just have to trick the board parser into ignoring the tag. However, this technique can also be used to bypass other filters as well so I'm going to leave it for you to figure out.

Waldo2k2
01-02-2004, 11:01 PM
>>.. to which people would simply hit the "next" button until they got to the end of the lesson. No-one (virtually anyway) will actually read it. That's imho.

nah, you put a quiz at the end bro :)