|
[F] Search flooding, wait 0 seconds ??? [R] [C-Imad Jomaa]
|
|
03-01-2009, 01:33 PM
(This post was last modified: 03-01-2009 02:46 PM by dvb.)
Post: #1
|
|||
|
|||
|
[F] Search flooding, wait 0 seconds ??? [R] [C-Imad Jomaa]
Found this little thingy when trying to search on a portuguese forum (it is not mine).
This happens with MyBB 1.4.4 (I asked the admins), and you can browse the forums here: http://www.pokeforum-pt.com/ If someone wants my login username & password, please PM, me or register a new account. Then you'll have to search, and search something again very fast (you have 60 secs) and see the 'you have to wait blabla seconds to..', and then, refresh the page till you get tens, eights, and if you can.. the zero. Here's the bug: http://i306.photobucket.com/albums/nn270.../phail.png Sorry if I forgot to inform you of anything else. |
|||
|
03-01-2009, 01:35 PM
Post: #2
|
|||
|
|||
|
RE: 0 seconds.. lol?
I've seen that before too. If you have 0 seconds to wait, you should be taken back to the search page.
Download My Plugins My Personal Site - Twitter |
|||
|
03-01-2009, 01:39 PM
Post: #3
|
|||
|
|||
|
RE: 0 seconds.. lol?
I'm pretty sure I wasn't redirected to the search page. But I might be wrong, idk.
|
|||
|
03-01-2009, 01:52 PM
Post: #4
|
|||
|
|||
| RE: 0 seconds.. lol? | |||
|
03-01-2009, 02:42 PM
Post: #5
|
|||
|
|||
|
RE: 0 seconds.. lol?
Should be rounded upward (ceil)
Just for the convenient of others, here is the related code: search.php, lines 1163-1192 Wrote: BTW, a 'LIMIT' should be added Creativity is a drug I cannot live without. |
|||
|
03-02-2009, 05:54 PM
(This post was last modified: 03-02-2009 05:54 PM by Ryan Gordon.)
Post: #6
|
|||
|
|||
|
RE: Search flooding, wait 0 seconds ???
Try this. Find in search.php
PHP Code: $remaining_time = $mybb->settings['searchfloodtime']-(TIME_NOW-$last_search['dateline']); replace with PHP Code: $remaining_time = $mybb->settings['searchfloodtime']-ceil((TIME_NOW-$last_search['dateline'])); |
|||
|
03-02-2009, 10:08 PM
Post: #7
|
|||
|
|||
RE: Search flooding, wait 0 seconds ???
(03-02-2009 05:54 PM)Ryan Gordon Wrote: Try this....Bad boy! ![]() Isn't is you that taught me to test & review many times before replying? lol I've tested your solution with some var_dump() few times with no success It's just occurred to me that the problem isn't with the rounding, where in the code the values being rounded? The problem is with the query: search.php, line 1176 Wrote: Should be ('>' instead of '>='): PHP Code: $query = $db->simple_select("searchlog", "*", "$conditions AND dateline > '$timecut'", array('order_by' => "dateline", 'order_dir' => "DESC")); Creativity is a drug I cannot live without. |
|||
|
03-02-2009, 11:20 PM
Post: #8
|
|||
|
|||
RE: Search flooding, wait 0 seconds ???
(03-02-2009 10:08 PM)dvb Wrote:(03-02-2009 05:54 PM)Ryan Gordon Wrote: Try this....Bad boy! 1) That's why I said try this. 2) That's why I didn't mark it as fixed 3) I was at school so I couldn't test it. 4) It obviously wasn't going to "break" anything Need more reasons? |
|||
|
03-03-2009, 12:59 PM
Post: #9
|
|||
|
|||
|
RE: Search flooding, wait 0 seconds ???
lol I was just kidding...
I know you'll never submit a fix without to thoroughly test it (03-02-2009 10:08 PM)dvb Wrote: The problem is with the query: This is logically correct and also pass all my tests, look: PHP Code: $remaining_time = $mybb->settings['searchfloodtime']-(TIME_NOW-$last_search['dateline']); ):PHP Code: $remaining_time = $mybb->$last_search['dateline']-$timecut; BTW, this will change the behavior a bit, but I don't think this second should be mattered. Since it's annoying to test this bug I've explained the logic of the fix but if someone still wants to further test it I'm suggesting to put the search flooding setting to 3-4 and to "catch" the problematic second. While testing if this fix works don't forget to check if it's actually fixed the problem (you could easily just miss the right second) In cases like this I'm asking myself about automated tests
Creativity is a drug I cannot live without. |
|||
|
03-03-2009, 05:32 PM
Post: #10
|
|||
|
|||
|
RE: Search flooding, wait 0 seconds ??? [R]
Sorry I can't try anything, they're not my forums.
And even if I edit the files on my forums, it's a little hard to know if it works or not, since getting the 'wait 0 seconds' message is very rare (to me). Thank you. |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)
Search
Member List
Calendar
Help




):