Skip to content

Commit

Permalink
fixes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarcil committed Aug 4, 2019
1 parent 510be5c commit ad97333
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Security/Sniffs/Drupal7/AdvisoriesContribSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ public function process(File $phpcsFile, $stackPtr) {
if ($a != $info['core'])
echo "WARNING Drupal core version inconsistence!!";
list ($a, $mversion) = explode('-', $info['version']);
$CVEversion = preg_replace('/^(\d+)\.(\d)$/','${1}.0${2}', $CVEversion);
$CVEversion = (float) $CVEversion;
if (preg_match('/dev/', $vcve[0]))
$phpcsFile->addWarning("WARNING module " . $info['project'] . " does not have any release for the security fix, manual checking required. Details: " . $vcve[1], $stackPtr, 'D7WarnAdvisoriesContribDev');
if (preg_match('/rc|alpha|beta/', $vcve[0]))
$phpcsFile->addWarning("WARNING module " . $info['project'] . " is using special version tagging around the security fix, manual checking recommanded. Details: " . $vcve[1], $stackPtr, 'D7WarnAdvisoriesContribrc');
$mversion = preg_replace('/^(\d+)\.(\d)$/','${1}.0${2}', $mversion);
$mversion = (float) $mversion;
$diff = $CVEversion - $mversion;
if ($diff > 0 && $diff < 1)
Expand Down

0 comments on commit ad97333

Please sign in to comment.