Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#17064 closed defect (bug) (fixed)

Upgrade SquirrelMail POP3 class

Reported by: aaroncampbell's profile aaroncampbell Owned by: westi's profile westi
Milestone: 3.2 Priority: normal
Severity: normal Version: 3.1
Component: External Libraries Keywords: has-patch
Focuses: Cc:

Description

I ran across this issue while looking into #16026 (removing ereg/eregi since it's deprecated in PHP 5.3). The SquirrelMail POP3 class we're using is 5 years old. The new version is NOT all that different, but upgrading WOULD remove all ereg/eregi usage.

Attachments (1)

17064.diff (3.6 KB) - added by aaroncampbell 13 years ago.

Download all attachments as: .zip

Change History (8)

@aaroncampbell
13 years ago

#1 @aaroncampbell
13 years ago

The code was taken straight from http://squirrelmail.org/docs/stable-code/__filesource/fsource_plugins_mail_fetch_pluginsmail_fetchclass.POP3.php.html

The main changes seem to be the replacement of ereg/eregi with preg_match, strpos, and stripos (for which they add a PHP4 compatibility bit at the end of the file...we could remove this if we so desire). They also switched to using $line{0} instead of $line[0] to get the first character of a string, and combined two str_replace calls into one.

All in all it looks to be a really clean drop-in that shouldn't hurt anything.

#2 @scribu
13 years ago

  • Component changed from General to External Libraries

#3 @westi
13 years ago

  • Milestone changed from Awaiting Review to 3.2
  • Owner set to westi
  • Status changed from new to assigned

#4 @solarissmoke
13 years ago

Related #10587 - the bug still exists in the latest version.

#5 @aaroncampbell
13 years ago

Something I'm curious about: It looks like SquirrelMail's POP3 class uses gettext (before and after this upgrade: _()). It looks like gettext is optional. Should we be dropping _() back into compat.php and put it back?

#6 @aaroncampbell
13 years ago

_() was added back in [17620] and [17622] so we should be good to go here.

#7 @ryan
13 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [17677]) Update pop3 class. Props aaroncampbell. fixes #17064

Note: See TracTickets for help on using tickets.