SMF Development > Fixed or Bogus Bugs

SMF 2.0.2 searching users by date broken -- patch

(1/2) > >>


I have found a small bug in the user management code.
If you go to Admin -> Users -> Search Users and set a criteria like "Last post < 2012-01-01" and then press Enter, the first page of results will be fine. But if you have more than one page of results, and you click on the second page link, for example, the search criteria will be dropped and you'll suddenly find that the number of pages substantially changed.

This is caused by the fact that $_POST['last_post'] is checked against the 'valid date' regexp, an then is converted to seconds-since-1970 format. Upon a repeated invocation the seconds-since-1970 formatted date doesn't pass the check and thus is dropped from the SQL search condition.

The attached patch fixes this by letting the seconds-since-1970 be a valid date format.

reported and fixed in 2.1 already

Hello anpaza,

thanks for the report and the fix!

FYI: this should be fixed in the development branch.

Ah, there's a bugtracker :)
Next time will look there first  :D

By the way, today found that the same happens if you delete such users after searching.
I had 8 pages of bogus user accounts (0 messages and last login earlier than one year ago).
I have selected the whole 1st page and pressed "Delete users".
After deletion there were 18 pages of users, e.g. the whole database.
So, the search criteria is dropped after deletion of users.
Has this been fixed?


[0] Message Index

[#] Next page

Go to full version