Opened 15 years ago
Closed 9 years ago
#10587 closed defect (bug) (invalid)
POP3 class does not differentiate between 0 messages and failure to login
Reported by: | robfelty | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9 |
Component: | Keywords: | ||
Focuses: | Cc: |
Description
The login function in wp-includes/class-pop3.php states that it returns false on failure, but it also returns false if there are no messages. These should be 2 different scenarios. I have fixed the problem. Here is an svn diff:
$ svn diff ../../../wp-includes/class-pop3.php Index: ../../../wp-includes/class-pop3.php =================================================================== --- ../../../wp-includes/class-pop3.php (revision 11572) +++ ../../../wp-includes/class-pop3.php (working copy) @@ -212,7 +212,8 @@ return false; } else { $count = $this->pass($pass); - if( (!$count) || ($count == -1) ) { + if( ($count===false) || ($count == -1) ) { + echo "count=$count\n"; // Preserve the error generated by last() and pass() return false; } else
Attachments (1)
Change History (7)
#3
@
14 years ago
- Keywords needs-patch added; email has-patch needs-testing removed
- Milestone changed from Unassigned to Future Release
Looks like class-pop3 can use an update eventually. http://sourceforge.net/projects/squirrelmail/develop
#4
@
14 years ago
- Keywords close added
We're upgrading the SquirrelMail POP3 class in #17064 but it doesn't look like it fixes this. However, I think this is a bug that needs to be reported to the SquirrelMail project.
For now if you receive false, just check POP3->ERROR. If it's empty then you got 0 messages and if it contains an error then the error explains what went wrong.
I recommend closing as wontfix. This is currently one of our few libraries that looks like we haven't modified at all.
This is an external, so this should be reported upstream. I don't think we should be making such a change.
Does this affect our usage of class-pop3 at all?
Is class-pop3 current?