-
-
Notifications
You must be signed in to change notification settings - Fork 436
Description
Describe the bug
The graph_start and graph_end request variables in graph_image.php only accept values less than 1600000000, which is Sun Sep 13 12:26:40 2020 in UTC (just 7 months from now!).
Note: at least graph_json.php, graph_xport.php and remote_agent.php are also affected.
To Reproduce
Steps to reproduce the behaviour:
- Obtain the ID of any graph.
- Open
http://host.example.com/cacti/graph_image.php?local_graph_id=123&graph_end=1600000000&disable_cache=true. - Bug: graph will not display the desired timespan and will instead ignore the
graph_endvariable. - Repeat step 2 using
1599999999if you wanna see it working, or just look at my screenshots.
Expected behavior
The example URL should display a timespan ranging from <today> until Sep 13 2020.
Screenshots
graph_image.phpusinggraph_end=1599999999
graph_image.phpusinggraph_end=1600000000
Desktop:
N/A
Smartphone:
N/A
Additional context
Relevant lines of code:
Lines 82 to 90 in bb619ef
| /* override: graph start time (unix time) */ | |
| if (!isempty_request_var('graph_start') && get_request_var('graph_start') < 1600000000) { | |
| $graph_data_array['graph_start'] = get_request_var('graph_start'); | |
| } | |
| /* override: graph end time (unix time) */ | |
| if (!isempty_request_var('graph_end') && get_request_var('graph_end') < 1600000000) { | |
| $graph_data_array['graph_end'] = get_request_var('graph_end'); | |
| } |
My suggestion is to compare these timestamps with something like now + 1 year instead of an hard-coded one. I don't mind preparing a pull request to fix this after further discussion about a solution.

