php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69289 fpm_status uses wrong time_format for json and xml output
Submitted: 2015-03-24 15:02 UTC Modified: 2019-06-26 09:42 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: rainer dot jung at kippdata dot de Assigned:
Status: Open Package: FPM related
PHP Version: 5.6.7 OS: Solaris 10 (and older)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rainer dot jung at kippdata dot de
New email:
PHP Version: OS:

 

 [2015-03-24 15:02 UTC] rainer dot jung at kippdata dot de
Description:
------------
The fpm status page contains an item "start time". It is shown in the text view as (example):

start time:           24/Mar/2015:14:18:15 +0100

In the json and xml views (short and full) it is shown as:

<start-time>%s</start-time>

resp.

{...,"start time":%s,...}

Instead of the correct time a verbatim "%s" is shown.

This is due to fpm_status.c setting

time_format = "%s";

in the xml and json case, but to

time_format = "%d/%b/%Y:%H:%M:%S %z";

in the text and html case. This format is then used in strftime(), e.g.

strftime(time_buffer, sizeof(time_buffer) - 1, time_format, localtime(&proc.start_epoch));

Unfortunately "%s" is not a correct strftime format pattern, so strftime does not format the time but instead returns the verbatim "%s" pattern.

Please replace 

time_format = "%s";

by

time_format = "%d/%b/%Y:%H:%M:%S %z";

or something else that formats correctly and returns valid xml and json data.

The bug applies to the current master branch and also to 5.6, 5.5 and 5.4.

Thanks a bunch!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-26 09:42 UTC] rainer dot jung at kippdata dot de
-Operating System: Any +Operating System: Solaris 10 (and older)
 [2019-06-26 09:42 UTC] rainer dot jung at kippdata dot de
The strftime %s problem is Solaris 10 (and older) specific. Linux and Solaris 11 know about %s in strftime.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Nov 16 23:01:41 2019 UTC