Skip to content

add type checking to generic_stats.inc.php for $vars['to'] and $vars['from']#14871

Merged
Jellyfrog merged 2 commits intolibrenms:masterfrom
VVelox:fix_stats_graph
Mar 2, 2023
Merged

add type checking to generic_stats.inc.php for $vars['to'] and $vars['from']#14871
Jellyfrog merged 2 commits intolibrenms:masterfrom
VVelox:fix_stats_graph

Conversation

@VVelox
Copy link
Copy Markdown
Contributor

@VVelox VVelox commented Mar 2, 2023

This resolves the issues with generic_stats.inc.php passing it from=-24hour/to=now instead of integers.

DO NOT DELETE THE UNDERLYING TEXT

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

@Jellyfrog Jellyfrog merged commit a0f1dab into librenms:master Mar 2, 2023
@murrant
Copy link
Copy Markdown
Member

murrant commented Mar 7, 2023

@VVelox this works, but GraphParameters should contain the actual timediff.

$timediff = $graph_params->to - $graph_params->from;

Try to use $graph_params over $vars when possible :)

@VVelox
Copy link
Copy Markdown
Contributor Author

VVelox commented Mar 7, 2023

@VVelox this works, but GraphParameters should contain the actual timediff.

$timediff = $graph_params->to - $graph_params->from;

Try to use $graph_params over $vars when possible :)

Nice! Did not know about those. Thanks! <3

@librenms-bot
Copy link
Copy Markdown

This pull request has been mentioned on LibreNMS Community. There might be relevant details there:

https://community.librenms.org/t/23-4-0-changelog/21194/1

TheMysteriousX pushed a commit to TheMysteriousX/librenms that referenced this pull request Aug 9, 2023
…'from'] (librenms#14871)

* make sure the $vars['from'] and $vars['to'] are actually numeric

* style fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants