Make WordPress Core

Opened 13 years ago

Closed 9 years ago

Last modified 8 years ago

#20673 closed defect (bug) (fixed)

Function split() is deprecated

Reported by: gregrobson's profile gregrobson Owned by: ocean90's profile 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 9 years ago.

Download all attachments as: .zip

Change History (14)

#1 @duck_
13 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
13 years ago

  • Component changed from General to External Libraries

#3 @gregrobson
13 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
11 years ago

#27382 was marked as a duplicate.

#5 @SergeyBiryukov
10 years ago

#28760 was marked as a duplicate.

#6 @ocean90
9 years ago

#36307 was marked as a duplicate.

#7 @ocean90
9 years 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
9 years 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
9 years 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
9 years ago

#11 @josephscott
9 years ago

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

#12 @SergeyBiryukov
9 years 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
8 years ago

#37194 was marked as a duplicate.

Note: See TracTickets for help on using tickets.