MyBB Community Forums

Full Version: [F] Mininum Message Length
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Really? The broswer does? How odd.

And no it doesn't...I tested this in SSH with mysql and no browser.

EDIT: Do you mean the browser does on the "post"? Not sure what you mean.

EDIT2: I took a few minutes and found out this:

inc/datahandlers/users.php from function verify_username()
		// Remove multiple spaces from the username
		$username = preg_replace("#\s{2,}#", " ", $username);

Hmm...
Double spaces in HTML don't get displayed (you need to use   ). Can't remember if it's actually stripped in usernames, but it's most definitely not stripped in practically every other place, including posts, post subjects, custom user fields etc etc.

I guess you can partly think of this as some way to get around an issue, but my point about there being many other ways to bypass this still holds Toungue
Yes I know that preventing every possible method is probably near impossible if it's even worth trying. This is totally a minor issue as I have mentioned. I just thought it weird and now I learned something new. Smile

What's interesting to me is that I am not typing HTML in the quick reply but your saying when it's posted via the form method that it parses it as such. hmm...never really considered that. It just seems really weird to me and doesn't fully make sense. If browsers already removed double spaces why the need for it to be removed in functions? And why doesn't the this display in SSH? Certainly putty doesn't remove double spaces.

So how do I make a post where I add double spaces or more and it gets inserted into the database? So weird because obviously php does recognize the space character otherwise it wouldn't count it. So ugh..again...something doesn't make sense to me.
Again, we don't remove double spaces at all. The HTML standard defines that multiple whitespace characters get displayed as one character and you need to use the   entity to have more than one space.

We do trim text at various places, that is " abc " will get shortened to "abc", if that's what you mean.
It's not that it gets removed when you submit a form it's just that the browsers rendering engine ignores extra spaces unless it's in a <pre> tag. Therefore, if you looked in the source code you will still double spaces, it would only just show up as one space.
I never realized this. Thanks and sorry so much for the trouble. Also thanks Tikitiki for fixing this. Personally I can't see how the my_strlen function having discount double spaces will effect negatively anything else. It's only for counting.
When I saw Zinga's post I removed the changes I made until a better decision could be made. At this point any changes from here on out need to run through Chris first. So it's up to Chris whether or not this should be implemented.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
Pages: 1 2