Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#10460 closed defect (bug) (duplicate)

PemFTP and phpmailer use ereg which is deprecated in PHP 5.3

Reported by: lloydbudd Owned by:
Milestone: Priority: high
Severity: major Version: 2.9
Component: Warnings/Notices Keywords:
Focuses: Cc:


ereg is deprecated in PHP 5.3 . Need to be replaced with preg family of functions.

$ ack ereg -l

Change History (12)

#1 @lloydbudd
6 years ago

  • Severity changed from normal to minor

#2 @dd32
6 years ago

Its a shame 60% of those are external libraries.. looks like some upstream patching is needed.

#3 @Speedboxer
6 years ago

As well, split will need to be replaced with preg_split.

#4 @Denis-de-Bernardy
6 years ago

  • Keywords needs-patch added; removed
  • Milestone changed from Future Release to 2.9
  • Priority changed from low to high
  • Severity changed from minor to major

#5 @eddieringle
6 years ago

  • Cc eddie@… added
  • Keywords changed from needs-patch php 5.3, deprecated to needs-patch php 5.3 deprecated

I ran ack-grep myself and found that the WordPress files in the list above do not contain any ereg functions, but phrases that contain the pattern 'ereg' (e.g. $pageregex, wp_deregister_style( $handle )).
The external libraries (class-*.php) do however contain ereg functions.
Has this been fixed, and that is why I am not seeing any ereg functions?

#6 @eddieringle
6 years ago

  • Keywords changed from needs-patch php 5.3 deprecated to needs-patch php 5.3, deprecated

#7 @eddieringle
6 years ago

  • Keywords changed from needs-patch php 5.3, deprecated to needs-patch, php 5.3, deprecated

#8 @ryan
6 years ago

  • Milestone changed from 2.9 to Future Release

class-pclzip.php uses ereg only if requested and mentions in a comment that it is deprecated.

That leaves the PemFTP files and phpmailer. PemFTP is used by class-wp-filesystem-ftpsockets.php. ftpsockets is used only other fs backends are unavailable. Fixing or replacing PemFTP is not priority.

New versions of phpmailer eliminate the eregi, but those versions require PHP5+. We can look into backporting ereg removal for a future WP release.

#9 @westi
6 years ago

  • Summary changed from ereg is deprecated in PHP 5.3 to PemFTP and phpmailer use ereg which is deprecated in PHP 5.3

Updating summary to make it easier to quickly identify what the issue is.

#10 @hakre
6 years ago

I can take care of phpmailer. I know the class since years and since the main project doesn't upgrade it any longer, we can freely apply changes w/o upstreaming.

#11 @solarissmoke
5 years ago

  • Keywords needs-patch php 5.3 deprecated removed
  • Resolution set to duplicate
  • Status changed from new to closed

#16026 is tagged for 3.2

#12 @nacin
5 years ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.