|
[F] Mininum Message Length
|
|
07-30-2008, 07:44 PM
(This post was last modified: 07-31-2008 12:51 AM by Ryan Gordon.)
Post: #1
|
|||
|
|||
[F] Mininum Message Length This user has been denied support.
I started to type this today:
Quote:Well..I know this isn't really a bug report and it's not really a suggestion either. Just something I noticed today where a bug was reported in one of my plugins (min title length). Seems you can use a double whitespace to override count of my_strlen which doesn't take into account those characters. IMHO that's a bit of a bug (yes minor) as mybb does remove double white space from most of it's posts and such. In the middle of that I decided to test the double whitespace issue with a post. Guess what I found. Min Message Length setting is broken in both 1.2.14 and 1.4 Beta 4. I have blank installs of both and neither works. Oddly though it seems to work here on Mybboard. Here is my beta board: http://beta.mybbcentral.com If you want my phpinfo settings PM me. (PHP Version 5.2.5) Not sure what is going on but it's odd. OK...also checked a second host...same issue. I tried at mybbfans though and it works (same host as mybboard?). IDIOT ME - Turns out as admin you don't have the min length. As a user account it works though. So back to original bug then. You can override the limit with whitespace as shown here: http://community.mybboard.net/thread-34420.html lol at my bug report. I could have edited it but heck..it's funny imho.EDIT: This will work if added to the my_strlen PHP Code: $str = preg_replace('/\s\s+/', ' ', $str); Oh...and I also see that you can use ALT 0160 trick: http://www.worldstart.com/tips/tips.php/1506 I made a test thread here with empty text. New MyBB plugin is "My Awards 2.0".
|
|||
|
07-31-2008, 12:05 AM
Post: #2
|
|||
|
|||
|
RE: Mininum Message Length
If we start stripping multiple spaces blindly we cause other problems. I'm not counting this as an actual issue since a space is an actual character whether or not anyone likes it.
|
|||
|
07-31-2008, 12:14 AM
(This post was last modified: 07-31-2008 12:15 AM by labrocca.)
Post: #3
|
|||
|
|||
RE: Mininum Message Length This user has been denied support.
Well it's not really stripping them it's removing them from the count in my_strlen. You already remove them adequetely in posts and messages imho. Since they do get stripped already in posts why not make sure that the characters placed into the database are the same ones counted in the function?
I know this is probably considered relatively minor but the fix is just as minor. Also maybe you misunderstand. I don't want to strip whitespaces just count multiple whitespaces as one. " " or " " would be replaced with " " for the purpose of the count which would coincide with the actual database insertion. New MyBB plugin is "My Awards 2.0".
|
|||
|
07-31-2008, 12:20 AM
(This post was last modified: 07-31-2008 12:23 AM by Ryan Gordon.)
Post: #4
|
|||
|
|||
|
RE: Mininum Message Length
hmm... okay, but where would the fix go and lets not use pregex. $str = str_replace(' ', ' ', $str); should work just as fine
|
|||
|
07-31-2008, 12:28 AM
(This post was last modified: 07-31-2008 12:30 AM by labrocca.)
Post: #5
|
|||
|
|||
RE: Mininum Message Length This user has been denied support.
Here is original function:
PHP Code: function my_strlen($string)Here is altered function: PHP Code: function my_strlen($string)One line should do it. New MyBB plugin is "My Awards 2.0".
|
|||
|
07-31-2008, 12:31 AM
Post: #6
|
|||
|
|||
|
RE: Mininum Message Length
That's not going to work. What if I have a username like "Ryan Gordon" - That's 11 characters, but the function would only return 10 which is wrong. And while it may not be a problem right now, it could most certainly cause many problems in the future.
|
|||
|
07-31-2008, 12:38 AM
(This post was last modified: 07-31-2008 12:42 AM by labrocca.)
Post: #7
|
|||
|
|||
RE: Mininum Message Length This user has been denied support.
Well...maybe you aren't aware of this but mybb removes a double space from a username when signing up. Try it. I double checked the database to be sure.
Even in posts Mybb removes a double space which I wasn't even aware of before. However like I said...it can be used to circumvent the character count function. "Ryan Gordon" using the alt-0160 method "Ryan Gordon" using basic space character See. And maybe you still don't understand...the function would only remove DOUBLE spaces...not single ones. Here look. I made an empty post: http://community.mybboard.net/thread-34431.html Look in the database...I bet it's 3 characters which is below the minimum setting. New MyBB plugin is "My Awards 2.0".
|
|||
|
07-31-2008, 12:41 AM
Post: #8
|
|||
|
|||
|
RE: Mininum Message Length
Err, mis-read that. It's been a long day...
|
|||
|
07-31-2008, 12:42 AM
Post: #9
|
|||
|
|||
RE: Mininum Message Length This user has been denied support.
Okay...I know sometimes we all make mistakes..as long as you understand now.
New MyBB plugin is "My Awards 2.0".
|
|||
|
07-31-2008, 12:49 AM
(This post was last modified: 07-31-2008 12:51 AM by Yumi.)
Post: #10
|
|||
|
|||
|
RE: Mininum Message Length
MyBB doesn't remove double spaces, the browser does.
It's not an issue at all IMO. I can think of at least 3 ways in how you can bypass these minimum message lengths, and it's simply not possible to patch up all of these. (empty tags, "hidden" unicode characters, fake url tags etc) EDIT: looks like I posted too late. Still, I don't think this is really an issue at all (and probably breaks more things than it fixes). |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)
Search
Member List
Calendar
Help

This user has been denied support.
I could have edited it but heck..it's funny imho.![[Image: 468x60_SF.gif]](http://supportforums.net/images/banners/468x60_SF.gif)


