Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for notices "Trying to access array offset on value of type bool" in ReportsCron.php #882

Merged
merged 1 commit into from
Oct 3, 2020

Conversation

heavygale
Copy link
Contributor

Proper check for success of query before accessing the result array.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

The following notices occure if there's no custom mail-template for e.g. trafficmaxpercent_subject available for the required language:

PHP Notice:  Trying to access array offset on value of type bool in /var/www/froxlor/lib/Froxlor/Cron/Traffic/ReportsCron.php on line 427
PHP Notice:  Trying to access array offset on value of type bool in /var/www/froxlor/lib/Froxlor/Cron/Traffic/ReportsCron.php on line 431

I succesfully tested the proposed changes on my own live Froxlor instance in the "Reaching your diskspace limit" use-case.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Proper check for success of query before accessing the result array. This notices occures if there's no custom mail-template for trafficmaxpercent_subject or trafficmaxpercent_mailbody for the required language.
@d00p d00p merged commit 244d282 into froxlor:master Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants