WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 7 months ago

Last modified 6 months ago

#20673 closed defect (bug) (fixed)

Function split() is deprecated

Reported by: gregrobson Owned by: ocean90
Milestone: 4.6 Priority: normal
Severity: trivial Version: 3.3.2
Component: External Libraries Keywords: needs-patch
Focuses: Cc:

Description

Encountered the following email error from a plugin.

Bei Fen has encountered an error: 8192, Function split() is deprecated, /wp-includes/rss.php, 104

I have checked rss.php, on line 104.

list($ns, $el) = split( ':', $element, 2);[[BR]]

change to

list($ns, $el) = explode( ':', $element, 2);[[BR]]

split() is now deprecated in PHP 5.3

Attachments (1)

20673.patch (636 bytes) - added by josephscott 7 months ago.

Download all attachments as: .zip

Change History (14)

#1 @duck_
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

wp-includes/rss.php is an external library that has been deprecated in WordPress (use SimplePie instead) so it will not be changed.

See #16325.

#2 @SergeyBiryukov
5 years ago

  • Component changed from General to External Libraries

#3 @gregrobson
5 years ago

Okay, I'll contact the writer of the Bei Fen plugin - I had 80+ emails in the space of a minute due to it's reliance on this file. This is only from one installation of WordPress!

Didn't realise the deprecated files would not be updated. This is the first time I've ever filed a suspected bug!

#4 @SergeyBiryukov
3 years ago

#27382 was marked as a duplicate.

#5 @SergeyBiryukov
2 years ago

#28760 was marked as a duplicate.

#6 @ocean90
9 months ago

#36307 was marked as a duplicate.

#7 @ocean90
7 months ago

  • Keywords has-patch added
  • Milestone set to 4.6
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Although these are external libraries it's in our responsibility to make sure that it doesn't break an install. Since split() was completely removed in PHP7 we should go with https://core.trac.wordpress.org/attachment/ticket/36307/36307.v2.patch.
It would also allow hosts to more easily upgrade to PHP7.

#8 @ocean90
7 months ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from reopened to closed

In 37402:

External Libraries: Replace split() with explode() in the deprecated Atom and MagpieRSS files.

Before PHP7 split() was throwing a deprecated notice, in PHP7 the function is completely removed and throws a fatal error.

Props achbed.
Fixes #20673.

#10 @ocean90
7 months ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

@josephscott Thanks, do you want to prepare a patch?

@josephscott
7 months ago

#11 @josephscott
7 months ago

Done. I'm just replacing it with explode().

#12 @SergeyBiryukov
7 months ago

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

In 37461:

External Libraries: After [37402], replace two more instances of split() with explode() in wp-includes/atomlib.php.

Props josephscott.
Fixes #20673.

#13 @pento
6 months ago

#37194 was marked as a duplicate.

Note: See TracTickets for help on using tickets.