Skip to content
Browse files

Fixed bug #20190 : Invalid regex in Squiz_Sniffs_WhiteSpace_Superfluo…

…usWhitespaceSniff
  • Loading branch information...
1 parent 6845085 commit 7a976e003d7c812f00b03866d33dfc32530cd3c3 @gsherwood gsherwood committed
View
2 CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php
@@ -197,7 +197,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
$tokenContent = rtrim($tokens[$stackPtr]['content'], $phpcsFile->eolChar);
if (empty($tokenContent) === false) {
- if (preg_match('|^.*\s+$|', $tokenContent) !== 0) {
+ if ($tokenContent !== rtrim($tokenContent)) {
$phpcsFile->addError('Whitespace found at end of line', $stackPtr, 'EndLine');
}
}
View
2 CodeSniffer/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.inc
@@ -45,5 +45,7 @@ function myFunction2()
// @codingStandardsChangeSetting Squiz.WhiteSpace.SuperfluousWhitespace ignoreBlankLines false
+// Уберём из системных свойств все кроме информации об услугах
+
?>
View
2 CodeSniffer/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php
@@ -55,7 +55,7 @@ public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc')
16 => 1,
23 => 1,
30 => 1,
- 48 => 1,
+ 50 => 1,
);
break;
case 'SuperfluousWhitespaceUnitTest.1.js':
View
1 package.xml
@@ -59,6 +59,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #20145 : Custom ruleset preferences directory over installed standard
- Fixed bug #20147 : phpcs-svn-pre-commit - no more default error report
- Fixed bug #20151 : Problem handling "if(): ... else: ... endif;" syntax
+ - Fixed bug #20190 : Invalid regex in Squiz_Sniffs_WhiteSpace_SuperfluousWhitespaceSniff
</notes>
<contents>
<dir name="/">

0 comments on commit 7a976e0

Please sign in to comment.
Something went wrong with that request. Please try again.