WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#17064 closed defect (bug) (fixed)

Upgrade SquirrelMail POP3 class

Reported by: aaroncampbell Owned by: 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 3 years ago.

Download all attachments as: .zip

Change History (8)

aaroncampbell3 years ago

comment:1 aaroncampbell3 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.

comment:2 scribu3 years ago

  • Component changed from General to External Libraries

comment:3 westi3 years ago

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

comment:4 solarissmoke3 years ago

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

comment:5 aaroncampbell3 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?

comment:6 aaroncampbell3 years ago

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

comment:7 ryan3 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.