WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 9 months ago

#42684 closed defect (bug) (duplicate)

This is driving me crazy. SimplePie bug with simple fix: Warning: A non-numeric value encountered in \wordpress\wp-includes\SimplePie\Parse\Date.php on line 694

Reported by: aquakitty Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: External Libraries Keywords: has-patch
Focuses: Cc:
PR Number:

Description

It was my understanding SimplePie has/is being updated, but this bug persists in WP 5.0. It is such a simple fix, why hasn't this been added? I use a feed on many websites that has a non-numeric value in the date, and every time I update I have to manually fix this issue.

Here is an example of an RSS feed that would cause the issue:

http://www.mortgagebrokernews.ca/rss/

The "T" in the timestamp

<updated>2017-11-23T09:20:00-05:00</updated>

<?php
$second = round($match[6] + $match[7] / pow(10, strlen($match[7])));

Fix:

<?php
$second = round((int)$match[6] + (int)$match[7] / pow(10, strlen($match[7])));

Attachments (1)

42684.diff (607 bytes) - added by aquakitty 2 years ago.

Download all attachments as: .zip

Change History (6)

@aquakitty
2 years ago

#1 follow-up: @dd32
2 years ago

  • Component changed from Feeds to External Libraries
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 5.0

Hi @aquakitty,

As SimplePie is an external library, we generally don't modify them directly.
SimplePie has a ticket open for this which I ran into just the other day: https://github.com/simplepie/simplepie/issues/534
However, due to the simple nature of the change, we'll probably just roll with this specific fix if isn't fixed upstream anytime soon.

#2 in reply to: ↑ 1 @aquakitty
23 months ago

Replying to dd32:

Hi @aquakitty,

As SimplePie is an external library, we generally don't modify them directly.
SimplePie has a ticket open for this which I ran into just the other day: https://github.com/simplepie/simplepie/issues/534
However, due to the simple nature of the change, we'll probably just roll with this specific fix if isn't fixed upstream anytime soon.

Great. Thank you.

#3 @daverobinsonpw
17 months ago

This had already been fixed in SimplePie, however the version included in Wordpress is 1.3.1 from 2012 so it's missing a lot of updates. Current version is 1.5.1
This particular issue was fixed in 1.4.3 you can see it in the following pull request https://github.com/simplepie/simplepie/pull/458

#4 @pento
12 months ago

  • Milestone changed from 5.0 to 5.1

#5 @pento
9 months ago

  • Milestone 5.1 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

As it's fixed in SimplePie, I'm going to close this issue in favour of the existing issue we have for updating SimplePie, #36669.

Note: See TracTickets for help on using tickets.