Skip to content

Commit ad97333

Browse files
committed
fixes #35
1 parent 510be5c commit ad97333

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Security/Sniffs/Drupal7/AdvisoriesContribSniff.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ public function process(File $phpcsFile, $stackPtr) {
5252
if ($a != $info['core'])
5353
echo "WARNING Drupal core version inconsistence!!";
5454
list ($a, $mversion) = explode('-', $info['version']);
55+
$CVEversion = preg_replace('/^(\d+)\.(\d)$/','${1}.0${2}', $CVEversion);
5556
$CVEversion = (float) $CVEversion;
5657
if (preg_match('/dev/', $vcve[0]))
5758
$phpcsFile->addWarning("WARNING module " . $info['project'] . " does not have any release for the security fix, manual checking required. Details: " . $vcve[1], $stackPtr, 'D7WarnAdvisoriesContribDev');
5859
if (preg_match('/rc|alpha|beta/', $vcve[0]))
5960
$phpcsFile->addWarning("WARNING module " . $info['project'] . " is using special version tagging around the security fix, manual checking recommanded. Details: " . $vcve[1], $stackPtr, 'D7WarnAdvisoriesContribrc');
61+
$mversion = preg_replace('/^(\d+)\.(\d)$/','${1}.0${2}', $mversion);
6062
$mversion = (float) $mversion;
6163
$diff = $CVEversion - $mversion;
6264
if ($diff > 0 && $diff < 1)

0 commit comments

Comments
 (0)