From 4694b4e1b4556602393ab9346f91462824a57172 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Apr 2024 14:11:34 +0200 Subject: [PATCH] Worl on CSS generation --- dev/tools/apstats.php | 65 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 9c6f6c7db87..06be8685d1e 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -74,6 +74,7 @@ $dirscc = ''; $dirphpstan = ''; $dir_phan = ''; $datatable_script = ''; +$url_root = ''; $i = 0; while ($i < $argc) { @@ -84,6 +85,8 @@ while ($i < $argc) { $dirphpstan = $reg[1]; } elseif (preg_match('/^--dir-phan=(.*)$/', $argv[$i], $reg)) { $dir_phan = $reg[1]; + } elseif (preg_match('/^--url-root=(.*)$/', $argv[$i], $reg)) { + $url_root = $reg[1]; } $i++; } @@ -723,18 +726,28 @@ if (count($output_phan_json) != 0) { // Last security errors +$title_security = "Last security issues"; $html .= '
'."\n"; -$html .= '

Last security issues (last '.($nbofmonth != 1 ? $nbofmonth.' months' : 'month').')

'."\n"; +$html .= '

'.$title_security.' (last '.($nbofmonth != 1 ? $nbofmonth.' months' : 'month').')

'."\n"; $html .= '
'."\n"; $html .= '
'."\n"; $html .= ''."\n"; $html .= ''."\n"; foreach ($arrayofalerts as $alert) { + $alert['url_commit'] = 'https://github.com/Dolibarr/dolibarr/commit/'.$alert['commitid']; + if (!empty($alert['issueid'])) { + $alert['url_issue'] = 'https://github.com/Dolibarr/dolibarr/issues/'.$alert['issueid']; + } + if (!empty($alert['issueidcve'])) { + $cve = preg_replace('/\s+/', '-', trim($alert['issueidcve'])); + $alert['url_cve'] = 'https://nvd.nist.gov/vuln/detail/CVE-'.$cve; + } + $html .= ''; $html .= ''; $html .= ''; $html .= ''; @@ -780,6 +793,50 @@ $html .= 'You can use this URL for RSS notifications: '); + fwrite($fh, ''); + fwrite($fh, ''); + fwrite($fh, '' . htmlspecialchars($title_security) . ''); + fwrite($fh, '' . htmlspecialchars("Feed of the latest security reports on the project") . ''); + if ($url_site) { + fwrite($fh, '' . htmlspecialchars($url_site) . ''); + } + if ($url_flux) { + fwrite($fh, ''); + } + + foreach ($arrayofalerts as $alert) { + fwrite($fh, ''); + fwrite($fh, '' . htmlspecialchars($alert['titre']) . ''); + fwrite($fh, '' . htmlspecialchars($alert['description']) . ''); + fwrite($fh, '' . htmlspecialchars($alert['url_commit']) . ''); + fwrite($fh, '' . htmlspecialchars($alert['date']) . ''); + fwrite($fh, ''); + } + + fwrite($fh, ''); + fwrite($fh, ''); + + fclose($fh); + + print 'Generation of RSS output file '.$outputfilerss.' done.'."\n"; +} else { + print 'Failed to generate the RSS file '.$outputfilerss."\n"; +} + + + // Technical debt PHPstan if ($dirphpstan != 'disabled') {
Commit IDDateReported on
Yogosha
Reported on
GIT
Reported on
CVE
Title
'; - $html .= ''.dol_trunc($alert['commitid'], 8).''; + $html .= ''.dol_trunc($alert['commitid'], 8).''; if (!empty($alert['commitidbis'])) { $html .= '
+
'; if (!empty($alert['issueid'])) { - $html .= '#'.$alert['issueid'].''; + $html .= '#'.$alert['issueid'].''; } else { //$html .= 'private'; } @@ -765,7 +778,7 @@ foreach ($arrayofalerts as $alert) { $html .= ''; if (!empty($alert['issueidcve'])) { $cve = preg_replace('/\s+/', '-', trim($alert['issueidcve'])); - $html .= 'CVE-'.$cve.''; + $html .= 'CVE-'.$cve.''; } $html .= ''.dol_escape_htmltag($alert['title']).'