Make WordPress Core

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's profile robfelty Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Mail 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)

class-pop3.diff (566 bytes) - added by robfelty 15 years ago.

Download all attachments as: .zip

Change History (7)

@robfelty
15 years ago

#1 @robfelty
15 years ago

  • Keywords has-patch needs-testing added

#2 @nacin
15 years ago

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?

#3 @nacin
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 @aaroncampbell
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.

#5 @codebykat
11 years ago

  • Cc kat@… added

#6 @chriscct7
9 years ago

  • Keywords needs-patch close removed
  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed

This was fixed upstream, and subsequently fixed in core

Note: See TracTickets for help on using tickets.