Topic: usernames with quotations

I have users who have registered with quotes " " in their names, it's braking the [ quote ] in posts. How can I stop them from registering with quotes?

Re: usernames with quotations

It shouldn't break the quotes. For example:

test"test wrote:

asdf

There's a special case if the username starts and ends in quotes, then the quotes won't show in the "User wrote:" part of the quote box, but other than that, it should work.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3 (edited by boneheade 2005-01-10 23:27)

Re: usernames with quotations

Well, it's breaking them. The user's name is like hello "aka" good-bye.

hello "aka" good-bye wrote:

this is a quote

When I remove the quotations from the name the quotes are rendered normally and the rest of the page is not broken.

4

Re: usernames with quotations

hello""what" wrote:

This is a test

Re: usernames with quotations

Can I stop them from registering with quotations?

Re: usernames with quotations

Ahh see everything is screwy..

7

Re: usernames with quotations

Parser is messing up. Its generating the closing tag for the blockquote but not the oppening tag among other things. Generally the tags are ending up improperly nested. Great fun.

Re: usernames with quotations

Ah, I see smile Lemme think.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: usernames with quotations

Solution. Open up include/parser.php and look for

        $text = preg_replace('#\[quote=("|"|\'|)(.{2,25})\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(\'[\', \'[\', \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);

Replace it with:

        $text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(\'[\', \'[\', \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);

That should do it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

10

Re: usernames with quotations

Should that be a permenant change.

Re: usernames with quotations

Yes. At least for now. I really don't know why it happens. The old {2,25} should work, but apparently, it doesn't. Man, I wish there was a way to debug regular expressions.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: usernames with quotations

Thank-you!

Re: usernames with quotations

Rickard wrote:

Man, I wish there was a way to debug regular expressions.

No kidding... *sigh*

Re: usernames with quotations

Rickard:

I just searched with Google for "regex debug". Is this something, that might be useful?

http://www.esperan.com/regex.html

Greetings

Re: usernames with quotations

Cool, I'll have to check it out.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: usernames with quotations

..and for pbb 1.2.5 with

Total number of registered users: 934
Total number of topics: 422
Total number of posts: 2946

and because of the high nomber of posts i need a script or something to remove
[right][snapback]xxx[/right][/snapback]  i can not do manually sad

thx