WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 4 weeks ago

#42684 new defect (bug)

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: 5.0 Priority: normal
Severity: normal Version: trunk
Component: External Libraries Keywords: has-patch
Focuses: Cc:

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 7 months ago.

Download all attachments as: .zip

Change History (4)

@aquakitty
7 months ago

#1 follow-up: @dd32
7 months 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
7 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
4 weeks 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

Note: See TracTickets for help on using tickets.