Make WordPress Core

Opened 7 years ago

Closed 4 years ago

#42515 closed defect (bug) (duplicate)

PHP 7.1 Warning: A non-numeric value encountered in \wordpress\wp-includes\SimplePie\Parse\Date.php on line 694

Reported by: aquakitty's profile aquakitty Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: External Libraries Keywords:
Focuses: Cc:

Description

When using the function get_permalink() for the RSS feed, I am getting this error.

I fixed it by casting match[] for now.

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

Change History (9)

#1 in reply to: ↑ description @aquakitty
7 years ago

Modified line:

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

#2 @ocean90
7 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Version 4.8.3 deleted

Hello @aquakitty, welcome to WordPress Trac!

Thanks for your report. SimplePie is a third-party library and core isn't using the latest one (see #36669). The warning has already been fixed in https://github.com/simplepie/simplepie/commit/1111dab1baced14aaf05509c41ee416c3fc6a961.

#3 @aquakitty
7 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #36669.

Great, thank you I tried finding this but I guess I need some work on my search skills.

#4 @johnbillion
7 years ago

  • Milestone Future Release deleted

#5 @julianathebanana
6 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened
  • Version set to 5.1

This problem is STILL there in Wordpress 5.1.1

I manually edited the line, but upon last automatic update the line reverted back to what it was.

Server: Ubuntu 18.04
PHP: 7.2
Nginx: 1.14.0

nginx server log is full of :
PHP message: PHP Warning: A non-numeric value encountered in /var/www/idyl.io/html/wp-includes/SimplePie/Parse/Date.php on line 694

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

#6 @knutsp
6 years ago

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

This ticket was closed as a duplicate of #36669. No reason was given indication this is not still a duplicate, so closing.

#7 @stevenjram
4 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

As of 30.04.2020, this error is still happening.

[30-Apr-2020 04:13:09 UTC] PHP Warning: A non-numeric value encountered in /..../..../public_html/wp-includes/SimplePie/Parse/Date.php on line 694

I've added the fix from above comment:
$second = round((int)$match[6] + (int)$match[7] / pow(10, strlen($match[7])));

and commented out the original:
$second = round($match[6] + $match[7] / pow(10, strlen($match[7])));

Thanks.

#8 @enps5
4 years ago

This error is still happening there too. Upgrading from php7.0 to php7.3 produced the following warning :

A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694PHP message: PHP Warning:  A non-numeric value encountered in /wp/wp-includes/SimplePie/Parse/Date.php on line 694" while reading response header from upstream, client: x.x.x.x, server: host.tld, request: "GET /article_id HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "sub.host.tld"

#9 @ocean90
4 years ago

  • Keywords needs-patch removed
  • Resolution set to duplicate
  • Status changed from reopened to closed
  • Version 5.1 deleted

The SimplePie update will be released in WordPress 5.5, see #36669.

Note: See TracTickets for help on using tickets.