When an anonymous user would request a new password for an account or email address that didn't exist, an unhandled error would occur. The problematic function in user.module is user_pass(). The password or account is loaded with user_load(). The check relies on there being a false value returned. user_load() loads the account information, and if it fails it returns a StdClass() object.
Attached is a patch to check whether or not the relevant information was loaded correctly. I also changed the error handling to not depend on a null or false value.
Please feel free to email me with questions.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | user.module.patch_4.txt | 262 bytes | magico |
| drupal-4.6.8-user.module.patch | 1.49 KB | chamuco |
Comments
Comment #1
stevenpatzI just tested this using my install of 4.6.8 and what I get when I enter in a username and email that doesn't exist is this:
Comment #2
heine commentedThis is only an issue on PHP 5 where empty objects (new StdClass) are True.
Comment #3
magico commentedI confirm this bug in 4.6.9 with PHP 5.0.4
Comment #4
magico commentedI checked the function
user_load()in 4.7 and it returns aFALSEinstead of aStdClass. Now the patch is very simple, but I request a comment from a senior developer to explain why in 4.6.9 was a StdClass returned instead of a FALSE?Will this affect in anyway, other functions that rely on the result of user_load() ?
Comment #5
chx commentedfor oldstable , i do not think this is acceptable. we must not change user_load return in a minor release..
Comment #6
magico commented@chx: so what is your opinion on how to solve this bug? The original patch provided in this issue?
Comment #7
magico commentedThis seems critical... so what do we do?
Comment #8
m3avrck commentedComment #9
chx commentedTed, explain before bumping versions. user_load now returns FALSE.
Comment #10
stevenpatzIs this still an issue? 4.6.x isn't supported anymore.
Comment #11
stevenpatzComment #12
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.