Skip to content

Commit

Permalink
Merge pull request #7 from lpeidro/feature/php-error-securities-fixed…
Browse files Browse the repository at this point in the history
…-report

First, check the deepest item in a multidimensional array
  • Loading branch information
omarlopesino authored Feb 13, 2024
2 parents e2af90d + 12a02b1 commit ca7a9b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SecuritiesFixedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ protected function getFolderSecurityAdvisoriesByDate(string $folder, string $dat
$security_advisories_list_by_package = $security_advisories['advisories'];
$security_advisories_list = call_user_func_array('array_merge', array_values($security_advisories_list_by_package));
$security_advisories_list = array_filter($security_advisories_list, function ($advisory) use ($date) {
$reported_at = $advisory['reportedAt'] ?? $advisory['reportedAt']['date'] ?? '';
if ($reported_at) {
$reported_at = $advisory['reportedAt']['date'] ?? $advisory['reportedAt'] ?? '';
if (!empty($reported_at)) {
$advisory_datetime = new \DateTime($reported_at);
return $advisory_datetime->getTimestamp() < $date->getTimestamp();
}
Expand Down

0 comments on commit ca7a9b3

Please sign in to comment.