Skip to content

Commit 278b643

Browse files
committed
Changelog + rename + message change for #2750
1 parent 34ebced commit 278b643

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

package.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
2828
<notes>
2929
- The PHP 7.4 numeric separator backfill now works correctly for more float formats
3030
- The PHP 7.4 numeric separator backfill is no longer run on PHP versions 7.4.0 or greater
31+
- Added Generic.PHP.DisallowRequestSuperglobal to ban the use of the $_REQUEST superglobal
32+
-- Thanks to Morerice for the contribution
3133
- Fixed bug #2688 : Case statements not tokenized correctly when switch is contained within ternary
3234
- Fixed bug #2698 : PHPCS throws errors determining auto report width when shell_exec is disabled
3335
-- Thanks to Matthew Peveler for the patch
@@ -249,7 +251,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
249251
<file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagStandard.xml" role="php" />
250252
<file baseinstalldir="PHP/CodeSniffer" name="DeprecatedFunctionsStandard.xml" role="php" />
251253
<file baseinstalldir="PHP/CodeSniffer" name="DisallowAlternativePHPTagsStandard.xml" role="php" />
252-
<file baseinstalldir="PHP/CodeSniffer" name="DisallowRequestSuperGlobalStandard.xml" role="php" />
254+
<file baseinstalldir="PHP/CodeSniffer" name="DisallowRequestSuperglobalStandard.xml" role="php" />
253255
<file baseinstalldir="PHP/CodeSniffer" name="DisallowShortOpenTagStandard.xml" role="php" />
254256
<file baseinstalldir="PHP/CodeSniffer" name="DiscourageGotoStandard.xml" role="php" />
255257
<file baseinstalldir="PHP/CodeSniffer" name="ForbiddenFunctionsStandard.xml" role="php" />
@@ -353,7 +355,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
353355
<file baseinstalldir="PHP/CodeSniffer" name="CharacterBeforePHPOpeningTagSniff.php" role="php" />
354356
<file baseinstalldir="PHP/CodeSniffer" name="ClosingPHPTagSniff.php" role="php" />
355357
<file baseinstalldir="PHP/CodeSniffer" name="DeprecatedFunctionsSniff.php" role="php" />
356-
<file baseinstalldir="PHP/CodeSniffer" name="DisallowRequestSuperGlobalSniff.php" role="php" />
358+
<file baseinstalldir="PHP/CodeSniffer" name="DisallowRequestSuperglobalSniff.php" role="php" />
357359
<file baseinstalldir="PHP/CodeSniffer" name="DisallowShortOpenTagSniff.php" role="php" />
358360
<file baseinstalldir="PHP/CodeSniffer" name="DisallowAlternativePHPTagsSniff.php" role="php" />
359361
<file baseinstalldir="PHP/CodeSniffer" name="DiscourageGotoSniff.php" role="php" />
@@ -613,8 +615,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
613615
<file baseinstalldir="PHP/CodeSniffer" name="DisallowAlternativePHPTagsUnitTest.2.inc.fixed" role="test" />
614616
<file baseinstalldir="PHP/CodeSniffer" name="DisallowAlternativePHPTagsUnitTest.3.inc" role="test" />
615617
<file baseinstalldir="PHP/CodeSniffer" name="DisallowAlternativePHPTagsUnitTest.php" role="test" />
616-
<file baseinstalldir="PHP/CodeSniffer" name="DisallowRequestSuperGlobalUnitTest.inc" role="test" />
617-
<file baseinstalldir="PHP/CodeSniffer" name="DisallowRequestSuperGlobalUnitTest.php" role="test" />
618+
<file baseinstalldir="PHP/CodeSniffer" name="DisallowRequestSuperglobalUnitTest.inc" role="test" />
619+
<file baseinstalldir="PHP/CodeSniffer" name="DisallowRequestSuperglobalUnitTest.php" role="test" />
618620
<file baseinstalldir="PHP/CodeSniffer" name="DisallowShortOpenTagUnitTest.1.inc" role="test" />
619621
<file baseinstalldir="PHP/CodeSniffer" name="DisallowShortOpenTagUnitTest.1.inc.fixed" role="test" />
620622
<file baseinstalldir="PHP/CodeSniffer" name="DisallowShortOpenTagUnitTest.2.inc" role="test" />
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<documentation title="$_REQUEST Super Global">
1+
<documentation title="$_REQUEST Superglobal">
22
<standard>
33
<![CDATA[
4-
$_REQUEST should never be used due to the ambiguity created to identify where the data is coming from. Use $_POST, $_GET or $_COOKIE instead
4+
$_REQUEST should never be used due to the ambiguity created as to where the data is coming from. Use $_POST, $_GET, or $_COOKIE instead.
55
]]>
66
</standard>
77
</documentation>

src/Standards/Generic/Sniffs/PHP/DisallowRequestSuperGlobalSniff.php renamed to src/Standards/Generic/Sniffs/PHP/DisallowRequestSuperglobalSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Ensures the $_REQUEST super global is not used
3+
* Ensures the $_REQUEST superglobal is not used
44
*
55
* @author Jeantwan Teuma <[email protected]>
66
* @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600)
@@ -12,7 +12,7 @@
1212
use PHP_CodeSniffer\Files\File;
1313
use PHP_CodeSniffer\Sniffs\Sniff;
1414

15-
class DisallowRequestSuperGlobalSniff implements Sniff
15+
class DisallowRequestSuperglobalSniff implements Sniff
1616
{
1717

1818

@@ -45,7 +45,7 @@ public function process(File $phpcsFile, $stackPtr)
4545
return;
4646
}
4747

48-
$error = 'The $_REQUEST super global should not be used. Use $_GET, $_POST or $_COOKIE instead';
48+
$error = 'The $_REQUEST superglobal should not be used; use $_GET, $_POST, or $_COOKIE instead';
4949
$phpcsFile->addError($error, $stackPtr, 'Found');
5050

5151
}//end process()

src/Standards/Generic/Tests/PHP/DisallowRequestSuperGlobalUnitTest.php renamed to src/Standards/Generic/Tests/PHP/DisallowRequestSuperglobalUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Unit test class for the DisallowRequestSuperGlobal sniff.
3+
* Unit test class for the DisallowRequestSuperglobal sniff.
44
*
55
* @author Jeantwan Teuma <[email protected]>
66
* @copyright 2006-2019 Squiz Pty Ltd (ABN 77 084 670 600)
@@ -10,7 +10,7 @@
1010

1111
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
1212

13-
class DisallowRequestSuperGlobalUnitTest extends AbstractSniffUnitTest
13+
class DisallowRequestSuperglobalUnitTest extends AbstractSniffUnitTest
1414
{
1515

1616

0 commit comments

Comments
 (0)