Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#44489 closed defect (bug) (fixed)

Use of deprecated each() function

Reported by: sterndata's profile sterndata Owned by: atimmer's profile atimmer
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Filesystem API Keywords: has-patch fixed-5.0
Focuses: Cc:

Description

Wordpress still uses the function each() which is deprecated in PHP 7.2.

http://php.net/manual/en/migration72.deprecated.php

wp-admin\includes\class-ftp.php line 778

(reported at https://wordpress.org/support/topic/function-each-deprecated-in-php-7-2/)

Attachments (2)

patch1.diff (497 bytes) - added by itowhid06 6 years ago.
patch2.diff (581 bytes) - added by itowhid06 6 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to Filesystem API
  • Milestone changed from Awaiting Review to 5.0

Related: #16026

#2 @itowhid06
6 years ago

It seems this library hasn't been updated in a while. that's why I'm proposing a patch(patch1.diff). Also it seems in fput() function, the variable $rest is being used without being passed as parameter(patch2.diff).

Last edited 6 years ago by itowhid06 (previous) (diff)

@itowhid06
6 years ago

@itowhid06
6 years ago

#3 @itowhid06
6 years ago

  • Keywords has-patch added

#4 @pento
6 years ago

In 43848:

FTP/PemFTP Library: Fix some PHP notices.

  • ftp_base::glob() used each(), which is deprecated as of PHP 7.2.
  • ftp_base::fget() was missing the decleration of its third parameter, $rest.

Props itowhid06.
See #44489.

#5 @pento
6 years ago

  • Keywords fixed-5.0 added

#6 @atimmer
6 years ago

  • Owner set to atimmer
  • Resolution set to fixed
  • Status changed from new to closed

In 44184:

FTP/PemFTP Library: Fix some PHP notices.

ftp_base::glob() used each(), which is deprecated as of PHP 7.2.
ftp_base::fget() was missing the decleration of its third parameter, $rest.

Props itowhid06, pento.
Merges [43848] to trunk.
Fixes #44489.

Note: See TracTickets for help on using tickets.