diff options
author | Robert Buchholz <rbu@goodpoint.de> | 2008-04-12 03:57:41 +0200 |
---|---|---|
committer | Robert Buchholz <rbu@goodpoint.de> | 2008-04-12 03:57:41 +0200 |
commit | 8abc30e65db82c48b28a78820a86c78885421c42 (patch) | |
tree | 459ffb1dedf74eee7635753c31f84f74bb5c9769 | |
parent | Add a "Sort References" function which will sort references (diff) | |
download | glsamaker-8abc30e65db82c48b28a78820a86c78885421c42.tar.gz glsamaker-8abc30e65db82c48b28a78820a86c78885421c42.tar.bz2 glsamaker-8abc30e65db82c48b28a78820a86c78885421c42.zip |
Parse description text in Boilerplate and add unlisted
CVE and GLSA ids to references.
-rw-r--r-- | frame-new.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/frame-new.php b/frame-new.php index c56a6a0..de9bbe5 100644 --- a/frame-new.php +++ b/frame-new.php @@ -357,6 +357,24 @@ bodyFooter_invoke(); $HTTP_POST_VARS['GLSA_Resolution'] .= $newLine.$newLine; $HTTP_POST_VARS['GLSA_Resolution'] .= 'We recommend that users unmerge '.$product.':'.$newLine.$newLine.'<code>'.$newLine.'# emerge --unmerge "'.$GLSAVersion['name'].'"</code>'; } + + } + + # Go through description and see if it lists any GLSAs or CVEs + if (preg_match_all("/(CVE-\d{4}-\d{4}|GLSA \d{6}-\d{2})/", $HTTP_POST_VARS['GLSA_Description'], $hits)) { + # Stuff we already have in references + $names = array(); + foreach ($GLSAReferences as $index => $array) { + $name = array_keys($array); + $names[$name[0]] = $name[0]; + } + + $hits = $hits[0]; + foreach($hits as $hit) { + if (array_key_exists($hit, $names) === FALSE) { + array_push($GLSAReferences, array($hit => "")); + } + } } } else echo generateWarning('Not all fields are completed - please make sure you have completed all the necessary fields!'); |