Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(secu): sanitize host dashboard #9406

Merged
merged 3 commits into from
Jan 19, 2021
Merged

Conversation

adr-mo
Copy link
Contributor

@adr-mo adr-mo commented Jan 18, 2021

Backport of https://github.com/centreon/centreon/pull/9372

Fixes # (issue)

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 19.10.x
  • 20.04.x
  • 20.10.x
  • 21.04.x (master)

How this pull request can be tested ?

Please describe the procedure to verify that the goal of the PR is matched. Provide clear instructions so that it can be correctly tested.

Any relevant details of the configuration to perform the test should be added.

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have made corresponding changes to the documentation.
  • I have rebased my development branch on the base branch (master, maintenance).

Comment on lines 70 to 71
if (
$period_choice == 'custom' &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (
$period_choice == 'custom' &&
if ($period_choice == 'custom' &&

Comment on lines 91 to 93
list($start_date, $end_date) = $interval;

return(array($start_date, $end_date));
Copy link
Contributor

@sc979 sc979 Jan 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JAC
why not return $interval ?
if interval contains only $start_date and $end_date

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not really thought it through 👍
I'll keep it this way for now

Comment on lines 42 to 44
$start_date = '';
$end_date = '';
$period_choice = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you convert these variables to camelCase

@adr-mo
Copy link
Contributor Author

adr-mo commented Jan 18, 2021

@sc979 Sure 👍

@adr-mo
Copy link
Contributor Author

adr-mo commented Jan 18, 2021

✔️ Done :)

@adr-mo adr-mo requested a review from sc979 January 18, 2021 14:51
@adr-mo adr-mo merged commit 37c2d45 into 2.8.x Jan 19, 2021
@adr-mo adr-mo deleted the MON-5922-sanitize-host-dashboard-28x branch January 19, 2021 08:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants