sdc-build-wp 4.1.0 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composer.json +2 -3
- package/composer.lock +3 -313
- package/index.js +38 -21
- package/lib/blocks.js +8 -6
- package/lib/style.js +17 -0
- package/package.json +1 -1
- package/vendor/composer/autoload_classmap.php +0 -37
- package/vendor/composer/autoload_psr4.php +0 -1
- package/vendor/composer/autoload_real.php +2 -0
- package/vendor/composer/autoload_static.php +0 -53
- package/vendor/composer/installed.json +1 -329
- package/vendor/composer/installed.php +3 -39
- package/vendor/composer/platform_check.php +26 -0
- package/lib/bustCache.js +0 -14
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md +0 -22
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/README.md +0 -285
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/composer.json +0 -71
- package/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php +0 -637
- package/vendor/phpcsstandards/phpcsextra/CHANGELOG.md +0 -590
- package/vendor/phpcsstandards/phpcsextra/LICENSE +0 -165
- package/vendor/phpcsstandards/phpcsextra/Modernize/Docs/FunctionCalls/DirnameStandard.xml +0 -40
- package/vendor/phpcsstandards/phpcsextra/Modernize/Sniffs/FunctionCalls/DirnameSniff.php +0 -382
- package/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/ArrayBraceSpacingStandard.xml +0 -94
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Docs/Arrays/CommaAfterLastStandard.xml +0 -43
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/ArrayBraceSpacingSniff.php +0 -305
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/Sniffs/Arrays/CommaAfterLastSniff.php +0 -226
- package/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/README.md +0 -573
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DisallowShortArraySyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/DuplicateArrayKeyStandard.xml +0 -44
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml +0 -40
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedKeyedUnkeyedArrayStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowAnonClassParenthesesStandard.xml +0 -24
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/DisallowFinalClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/ModifierKeywordOrderStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireAnonClassParenthesesStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Classes/RequireFinalClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ConstructorDestructorReturnStandard.xml +0 -64
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/ForeachUniqueAssignmentStandard.xml +0 -26
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoDoubleNegativeStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/NoEchoSprintfStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/CodeAnalysis/StaticInFinalClassStandard.xml +0 -43
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/LowercaseClassResolutionKeywordStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/ModifierKeywordOrderStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Constants/UppercaseMagicConstantsStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowAlternativeSyntaxStandard.xml +0 -35
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/DisallowLonelyIfStandard.xml +0 -49
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/ControlStructures/IfElseDeclarationStandard.xml +0 -37
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Files/SeparateFunctionsFromOOStandard.xml +0 -45
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/NoLongClosuresStandard.xml +0 -42
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/FunctionDeclarations/RequireFinalMethodsInTraitsStandard.xml +0 -33
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowLongListSyntaxStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Lists/DisallowShortListSyntaxStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowCurlyBraceSyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/DisallowDeclarationWithoutNameStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/EnforceCurlyBraceSyntaxStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Namespaces/OneDeclarationPerFileStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/NamingConventions/NoReservedKeywordParameterNamesStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/OOStructures/AlphabeticExtendsImplementsStandard.xml +0 -27
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/ConcatPositionStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowLogicalAndOrStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowShortTernaryStandard.xml +0 -26
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/DisallowStandalonePostIncrementDecrementStandard.xml +0 -44
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/StrictComparisonsStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/Operators/TypeSeparatorSpacingStandard.xml +0 -33
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/LowercasePHPTagStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/PHP/OneStatementInShortEchoTagStandard.xml +0 -41
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowMixedGroupUseStandard.xml +0 -39
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseClassStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseConstStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/DisallowUseFunctionStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/KeywordSpacingStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/LowercaseFunctionConstStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoLeadingBackslashStandard.xml +0 -23
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/UseStatements/NoUselessAliasesStandard.xml +0 -30
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/AnonClassKeywordSpacingStandard.xml +0 -31
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/CommaSpacingStandard.xml +0 -94
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/DisallowInlineTabsStandard.xml +0 -25
- package/vendor/phpcsstandards/phpcsextra/Universal/Docs/WhiteSpace/PrecisionAlignmentStandard.xml +0 -29
- package/vendor/phpcsstandards/phpcsextra/Universal/Helpers/DummyTokenizer.php +0 -60
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php +0 -89
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php +0 -297
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedArrayKeyTypesSniff.php +0 -174
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/MixedKeyedUnkeyedArraySniff.php +0 -134
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowAnonClassParenthesesSniff.php +0 -112
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/DisallowFinalClassSniff.php +0 -116
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php +0 -188
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireAnonClassParenthesesSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Classes/RequireFinalClassSniff.php +0 -102
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/ForeachUniqueAssignmentSniff.php +0 -153
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoDoubleNegativeSniff.php +0 -269
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/NoEchoSprintfSniff.php +0 -131
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/CodeAnalysis/StaticInFinalClassSniff.php +0 -216
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php +0 -106
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/ModifierKeywordOrderSniff.php +0 -199
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Constants/UppercaseMagicConstantsSniff.php +0 -89
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowAlternativeSyntaxSniff.php +0 -216
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/DisallowLonelyIfSniff.php +0 -348
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/ControlStructures/IfElseDeclarationSniff.php +0 -164
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Files/SeparateFunctionsFromOOSniff.php +0 -190
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/NoLongClosuresSniff.php +0 -233
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/FunctionDeclarations/RequireFinalMethodsInTraitsSniff.php +0 -120
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php +0 -71
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowShortListSyntaxSniff.php +0 -86
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowCurlyBraceSyntaxSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/DisallowDeclarationWithoutNameSniff.php +0 -80
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/EnforceCurlyBraceSyntaxSniff.php +0 -81
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Namespaces/OneDeclarationPerFileSniff.php +0 -96
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/NamingConventions/NoReservedKeywordParameterNamesSniff.php +0 -190
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/OOStructures/AlphabeticExtendsImplementsSniff.php +0 -275
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/ConcatPositionSniff.php +0 -204
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowLogicalAndOrSniff.php +0 -112
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowShortTernarySniff.php +0 -76
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/DisallowStandalonePostIncrementDecrementSniff.php +0 -197
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/StrictComparisonsSniff.php +0 -116
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Operators/TypeSeparatorSpacingSniff.php +0 -85
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/LowercasePHPTagSniff.php +0 -87
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/PHP/OneStatementInShortEchoTagSniff.php +0 -101
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php +0 -248
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php +0 -211
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/KeywordSpacingSniff.php +0 -207
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/LowercaseFunctionConstSniff.php +0 -156
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoLeadingBackslashSniff.php +0 -170
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php +0 -155
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/AnonClassKeywordSpacingSniff.php +0 -79
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php +0 -408
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php +0 -173
- package/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php +0 -445
- package/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml +0 -5
- package/vendor/phpcsstandards/phpcsextra/composer.json +0 -69
- package/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist +0 -36
- package/vendor/phpcsstandards/phpcsutils/CHANGELOG.md +0 -1106
- package/vendor/phpcsstandards/phpcsutils/LICENSE +0 -165
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php +0 -551
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php +0 -781
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php +0 -123
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php +0 -202
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php +0 -44
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php +0 -47
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php +0 -43
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php +0 -50
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php +0 -246
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php +0 -218
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php +0 -687
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php +0 -269
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php +0 -164
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php +0 -75
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php +0 -459
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php +0 -837
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php +0 -55
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php +0 -227
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php +0 -156
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php +0 -232
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php +0 -276
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php +0 -828
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php +0 -262
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php +0 -359
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/MessageHelper.php +0 -145
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php +0 -389
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/NamingConventions.php +0 -116
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php +0 -322
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php +0 -359
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php +0 -252
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Orthography.php +0 -120
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php +0 -419
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php +0 -510
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php +0 -143
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php +0 -331
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php +0 -432
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php +0 -333
- package/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml +0 -4
- package/vendor/phpcsstandards/phpcsutils/README.md +0 -297
- package/vendor/phpcsstandards/phpcsutils/composer.json +0 -92
- package/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php +0 -68
- package/vendor/wp-coding-standards/wpcs/CHANGELOG.md +0 -1654
- package/vendor/wp-coding-standards/wpcs/LICENSE +0 -21
- package/vendor/wp-coding-standards/wpcs/README.md +0 -261
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractArrayAssignmentRestrictionsSniff.php +0 -261
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractClassRestrictionsSniff.php +0 -257
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionParameterSniff.php +0 -111
- package/vendor/wp-coding-standards/wpcs/WordPress/AbstractFunctionRestrictionsSniff.php +0 -358
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayIndentationStandard.xml +0 -116
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/ArrayKeySpacingRestrictionsStandard.xml +0 -31
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml +0 -50
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/CodeAnalysis/EscapedNotTranslatedStandard.xml +0 -24
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/CurrentTimeTimestampStandard.xml +0 -35
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/DateTime/RestrictedFunctionsStandard.xml +0 -54
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml +0 -119
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidHookNameStandard.xml +0 -35
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/NamingConventions/ValidPostTypeSlugStandard.xml +0 -121
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/IniSetStandard.xml +0 -40
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/StrictInArrayStandard.xml +0 -53
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/PHP/YodaConditionsStandard.xml +0 -27
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/Security/SafeRedirectStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapabilitiesStandard.xml +0 -69
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CapitalPDangitStandard.xml +0 -43
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/ClassNameCaseStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/CronIntervalStandard.xml +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedClassesStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedFunctionsStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParameterValuesStandard.xml +0 -23
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/DeprecatedParametersStandard.xml +0 -40
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourceParametersStandard.xml +0 -92
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/EnqueuedResourcesStandard.xml +0 -57
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WP/PostsPerPageStandard.xml +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml +0 -27
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml +0 -150
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/ObjectOperatorSpacingStandard.xml +0 -19
- package/vendor/wp-coding-standards/wpcs/WordPress/Docs/WhiteSpace/OperatorSpacingStandard.xml +0 -61
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ArrayWalkingFunctionsHelper.php +0 -108
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ConstantsHelper.php +0 -135
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ContextHelper.php +0 -394
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/DeprecationHelper.php +0 -84
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/EscapingFunctionsTrait.php +0 -256
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/FormattingFunctionsHelper.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/IsUnitTestTrait.php +0 -238
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ListHelper.php +0 -101
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/MinimumWPVersionTrait.php +0 -159
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/PrintingFunctionsTrait.php +0 -122
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/RulesetPropertyHelper.php +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SanitizationHelperTrait.php +0 -418
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/SnakeCaseHelper.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/UnslashingFunctionsHelper.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/ValidationHelper.php +0 -349
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/VariableHelper.php +0 -262
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPDBTrait.php +0 -115
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPGlobalVariablesHelper.php +0 -312
- package/vendor/wp-coding-standards/wpcs/WordPress/Helpers/WPHookHelper.php +0 -113
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php +0 -72
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayDeclarationSpacingSniff.php +0 -252
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayIndentationSniff.php +0 -550
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/ArrayKeySpacingRestrictionsSniff.php +0 -174
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Arrays/MultipleStatementAlignmentSniff.php +0 -583
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/AssignmentInTernaryConditionSniff.php +0 -173
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/CodeAnalysis/EscapedNotTranslatedSniff.php +0 -89
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/DirectDatabaseQuerySniff.php +0 -301
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLPlaceholdersSniff.php +0 -761
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/PreparedSQLSniff.php +0 -242
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php +0 -57
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/RestrictedFunctionsSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DB/SlowDBQuerySniff.php +0 -58
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/CurrentTimeTimestampSniff.php +0 -168
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/DateTime/RestrictedFunctionsSniff.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Files/FileNameSniff.php +0 -313
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php +0 -1297
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidFunctionNameSniff.php +0 -188
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php +0 -277
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidPostTypeSlugSniff.php +0 -230
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/ValidVariableNameSniff.php +0 -289
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DevelopmentFunctionsSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php +0 -100
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php +0 -52
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/IniSetSniff.php +0 -193
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/NoSilencedErrorsSniff.php +0 -245
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/POSIXFunctionsSniff.php +0 -73
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/PregQuoteDelimiterSniff.php +0 -70
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/StrictInArraySniff.php +0 -122
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/TypeCastsSniff.php +0 -90
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/PHP/YodaConditionsSniff.php +0 -124
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/EscapeOutputSniff.php +0 -903
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/NonceVerificationSniff.php +0 -422
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/PluginMenuSlugSniff.php +0 -126
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/SafeRedirectSniff.php +0 -45
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php +0 -244
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php +0 -862
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/AlternativeFunctionsSniff.php +0 -371
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapabilitiesSniff.php +0 -478
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CapitalPDangitSniff.php +0 -315
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/ClassNameCaseSniff.php +0 -897
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/CronIntervalSniff.php +0 -321
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedClassesSniff.php +0 -152
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php +0 -1708
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParameterValuesSniff.php +0 -291
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DeprecatedParametersSniff.php +0 -509
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedConstantsSniff.php +0 -160
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/DiscouragedFunctionsSniff.php +0 -54
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourceParametersSniff.php +0 -241
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/EnqueuedResourcesSniff.php +0 -108
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/GlobalVariablesOverrideSniff.php +0 -436
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php +0 -977
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/PostsPerPageSniff.php +0 -102
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/CastStructureSpacingSniff.php +0 -59
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php +0 -486
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php +0 -63
- package/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WhiteSpace/OperatorSpacingSniff.php +0 -60
- package/vendor/wp-coding-standards/wpcs/WordPress/ruleset.xml +0 -13
- package/vendor/wp-coding-standards/wpcs/WordPress-Core/ruleset.xml +0 -948
- package/vendor/wp-coding-standards/wpcs/WordPress-Docs/ruleset.xml +0 -109
- package/vendor/wp-coding-standards/wpcs/WordPress-Extra/ruleset.xml +0 -199
- package/vendor/wp-coding-standards/wpcs/composer.json +0 -88
- package/vendor/wp-coding-standards/wpcs/phpcs.xml.dist.sample +0 -153
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Helpers;
|
|
11
|
-
|
|
12
|
-
use PHP_CodeSniffer\Files\File;
|
|
13
|
-
use PHP_CodeSniffer\Util\Tokens;
|
|
14
|
-
use PHPCSUtils\Utils\Context;
|
|
15
|
-
use PHPCSUtils\Utils\TextStrings;
|
|
16
|
-
use WordPressCS\WordPress\Helpers\ArrayWalkingFunctionsHelper;
|
|
17
|
-
use WordPressCS\WordPress\Helpers\ContextHelper;
|
|
18
|
-
use WordPressCS\WordPress\Helpers\RulesetPropertyHelper;
|
|
19
|
-
use WordPressCS\WordPress\Helpers\UnslashingFunctionsHelper;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Helper functions and function lists for checking whether a sanitizing function is being used.
|
|
23
|
-
*
|
|
24
|
-
* Any sniff class which incorporates this trait will automatically support the
|
|
25
|
-
* following `public` properties which can be changed from within a custom ruleset:
|
|
26
|
-
* - `customSanitizingFunctions`.
|
|
27
|
-
* - `customUnslashingSanitizingFunctions`
|
|
28
|
-
*
|
|
29
|
-
* ---------------------------------------------------------------------------------------------
|
|
30
|
-
* This trait is only intended for internal use by WordPressCS and is not part of the public API.
|
|
31
|
-
* This also means that it has no promise of backward compatibility. Use at your own risk.
|
|
32
|
-
* ---------------------------------------------------------------------------------------------
|
|
33
|
-
*
|
|
34
|
-
* @internal
|
|
35
|
-
*
|
|
36
|
-
* @since 3.0.0 The properties in this trait were previously contained partially in the
|
|
37
|
-
* `WordPressCS\WordPress\Sniff` class and partially in the `NonceVerificationSniff`
|
|
38
|
-
* and the `ValidatedSanitizedInputSniff` classes and have been moved here.
|
|
39
|
-
* The pre-existing methods in this trait were previously contained in the
|
|
40
|
-
* `WordPressCS\WordPress\Sniff` class and have been moved here.
|
|
41
|
-
*/
|
|
42
|
-
trait SanitizationHelperTrait {
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Custom list of functions that sanitize the values passed to them.
|
|
46
|
-
*
|
|
47
|
-
* @since 0.5.0
|
|
48
|
-
* @since 3.0.0 Moved from the NonceVerification and the ValidatedSanitizedInput sniff classes to this trait.
|
|
49
|
-
*
|
|
50
|
-
* @var string[]
|
|
51
|
-
*/
|
|
52
|
-
public $customSanitizingFunctions = array();
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Custom sanitizing functions that implicitly unslash the values passed to them.
|
|
56
|
-
*
|
|
57
|
-
* @since 0.5.0
|
|
58
|
-
* @since 3.0.0 Moved from the NonceVerification and the ValidatedSanitizedInput sniff classes to this trait.
|
|
59
|
-
*
|
|
60
|
-
* @var string[]
|
|
61
|
-
*/
|
|
62
|
-
public $customUnslashingSanitizingFunctions = array();
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Functions that sanitize values.
|
|
66
|
-
*
|
|
67
|
-
* This list is complementary to the `$unslashingSanitizingFunctions`
|
|
68
|
-
* list.
|
|
69
|
-
* Sanitizing functions should be added to this list if they do *not*
|
|
70
|
-
* implicitly unslash data and to the `$unslashingsanitizingFunctions`
|
|
71
|
-
* list if they do.
|
|
72
|
-
*
|
|
73
|
-
* @since 0.5.0
|
|
74
|
-
* @since 0.11.0 Changed from public static to protected non-static.
|
|
75
|
-
* @since 3.0.0 - Moved from the Sniff class to this trait.
|
|
76
|
-
* - Visibility changed from protected to private.
|
|
77
|
-
*
|
|
78
|
-
* @var array<string, true>
|
|
79
|
-
*/
|
|
80
|
-
private $sanitizingFunctions = array(
|
|
81
|
-
'_wp_handle_upload' => true,
|
|
82
|
-
'esc_url_raw' => true,
|
|
83
|
-
'filter_input' => true,
|
|
84
|
-
'filter_var' => true,
|
|
85
|
-
'hash_equals' => true,
|
|
86
|
-
'is_email' => true,
|
|
87
|
-
'number_format' => true,
|
|
88
|
-
'sanitize_bookmark_field' => true,
|
|
89
|
-
'sanitize_bookmark' => true,
|
|
90
|
-
'sanitize_email' => true,
|
|
91
|
-
'sanitize_file_name' => true,
|
|
92
|
-
'sanitize_hex_color_no_hash' => true,
|
|
93
|
-
'sanitize_hex_color' => true,
|
|
94
|
-
'sanitize_html_class' => true,
|
|
95
|
-
'sanitize_meta' => true,
|
|
96
|
-
'sanitize_mime_type' => true,
|
|
97
|
-
'sanitize_option' => true,
|
|
98
|
-
'sanitize_sql_orderby' => true,
|
|
99
|
-
'sanitize_term_field' => true,
|
|
100
|
-
'sanitize_term' => true,
|
|
101
|
-
'sanitize_text_field' => true,
|
|
102
|
-
'sanitize_textarea_field' => true,
|
|
103
|
-
'sanitize_title_for_query' => true,
|
|
104
|
-
'sanitize_title_with_dashes' => true,
|
|
105
|
-
'sanitize_title' => true,
|
|
106
|
-
'sanitize_url' => true,
|
|
107
|
-
'sanitize_user_field' => true,
|
|
108
|
-
'sanitize_user' => true,
|
|
109
|
-
'validate_file' => true,
|
|
110
|
-
'wp_handle_sideload' => true,
|
|
111
|
-
'wp_handle_upload' => true,
|
|
112
|
-
'wp_kses_allowed_html' => true,
|
|
113
|
-
'wp_kses_data' => true,
|
|
114
|
-
'wp_kses_one_attr' => true,
|
|
115
|
-
'wp_kses_post' => true,
|
|
116
|
-
'wp_kses' => true,
|
|
117
|
-
'wp_parse_id_list' => true,
|
|
118
|
-
'wp_redirect' => true,
|
|
119
|
-
'wp_safe_redirect' => true,
|
|
120
|
-
'wp_sanitize_redirect' => true,
|
|
121
|
-
'wp_strip_all_tags' => true,
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Sanitizing functions that implicitly unslash the data passed to them.
|
|
126
|
-
*
|
|
127
|
-
* This list is complementary to the `$sanitizingFunctions` list.
|
|
128
|
-
* Sanitizing functions should be added to this list if they also
|
|
129
|
-
* implicitely unslash data and to the `$sanitizingFunctions` list
|
|
130
|
-
* if they don't.
|
|
131
|
-
*
|
|
132
|
-
* @since 0.5.0
|
|
133
|
-
* @since 0.11.0 Changed from public static to protected non-static.
|
|
134
|
-
* @since 3.0.0 - Moved from the Sniff class to this trait.
|
|
135
|
-
* - Visibility changed from protected to private.
|
|
136
|
-
*
|
|
137
|
-
* @var array<string, bool>
|
|
138
|
-
*/
|
|
139
|
-
private $unslashingSanitizingFunctions = array(
|
|
140
|
-
'absint' => true,
|
|
141
|
-
'boolval' => true,
|
|
142
|
-
'count' => true,
|
|
143
|
-
'doubleval' => true,
|
|
144
|
-
'floatval' => true,
|
|
145
|
-
'intval' => true,
|
|
146
|
-
'sanitize_key' => true,
|
|
147
|
-
'sanitize_locale_name' => true,
|
|
148
|
-
'sizeof' => true,
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Cache of previously added custom functions.
|
|
153
|
-
*
|
|
154
|
-
* Prevents having to do the same merges over and over again.
|
|
155
|
-
*
|
|
156
|
-
* @since 0.4.0
|
|
157
|
-
* @since 0.11.0 - Changed from public static to protected non-static.
|
|
158
|
-
* - Changed the format from simple bool to array.
|
|
159
|
-
* @since 3.0.0 - Moved from the NonceVerification and the ValidatedSanitizedInput sniff classes to this class.
|
|
160
|
-
* - Visibility changed from protected to private.
|
|
161
|
-
*
|
|
162
|
-
* @var array<string, string[]>
|
|
163
|
-
*/
|
|
164
|
-
private $addedCustomSanitizingFunctions = array(
|
|
165
|
-
'sanitize' => array(),
|
|
166
|
-
'unslashsanitize' => array(),
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Combined list of WP/PHP native and custom sanitizing functions.
|
|
171
|
-
*
|
|
172
|
-
* @since 3.0.0
|
|
173
|
-
*
|
|
174
|
-
* @var array<string, bool>
|
|
175
|
-
*/
|
|
176
|
-
private $allSanitizingFunctions = array();
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Combined list of WP/PHP native and custom sanitizing and unslashing functions.
|
|
180
|
-
*
|
|
181
|
-
* @since 3.0.0
|
|
182
|
-
*
|
|
183
|
-
* @var array<string, bool>
|
|
184
|
-
*/
|
|
185
|
-
private $allUnslashingSanitizingFunctions = array();
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Retrieve a list of all known sanitizing functions.
|
|
189
|
-
*
|
|
190
|
-
* @since 3.0.0
|
|
191
|
-
*
|
|
192
|
-
* @return array<string, bool>
|
|
193
|
-
*/
|
|
194
|
-
final public function get_sanitizing_functions() {
|
|
195
|
-
if ( array() === $this->allSanitizingFunctions
|
|
196
|
-
|| $this->customSanitizingFunctions !== $this->addedCustomSanitizingFunctions['sanitize']
|
|
197
|
-
) {
|
|
198
|
-
$this->allSanitizingFunctions = RulesetPropertyHelper::merge_custom_array(
|
|
199
|
-
$this->customSanitizingFunctions,
|
|
200
|
-
$this->sanitizingFunctions
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
$this->addedCustomSanitizingFunctions['sanitize'] = $this->customSanitizingFunctions;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return $this->allSanitizingFunctions;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Retrieve a list of all known sanitizing and unslashing functions.
|
|
211
|
-
*
|
|
212
|
-
* @since 3.0.0
|
|
213
|
-
*
|
|
214
|
-
* @return array<string, bool>
|
|
215
|
-
*/
|
|
216
|
-
final public function get_sanitizing_and_unslashing_functions() {
|
|
217
|
-
if ( array() === $this->allUnslashingSanitizingFunctions
|
|
218
|
-
|| $this->customUnslashingSanitizingFunctions !== $this->addedCustomSanitizingFunctions['unslashsanitize']
|
|
219
|
-
) {
|
|
220
|
-
$this->allUnslashingSanitizingFunctions = RulesetPropertyHelper::merge_custom_array(
|
|
221
|
-
$this->customUnslashingSanitizingFunctions,
|
|
222
|
-
$this->unslashingSanitizingFunctions
|
|
223
|
-
);
|
|
224
|
-
|
|
225
|
-
$this->addedCustomSanitizingFunctions['unslashsanitize'] = $this->customUnslashingSanitizingFunctions;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return $this->allUnslashingSanitizingFunctions;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Check if a particular function is regarded as a sanitizing function.
|
|
233
|
-
*
|
|
234
|
-
* @since 3.0.0
|
|
235
|
-
*
|
|
236
|
-
* @param string $functionName The name of the function to check.
|
|
237
|
-
*
|
|
238
|
-
* @return bool
|
|
239
|
-
*/
|
|
240
|
-
final public function is_sanitizing_function( $functionName ) {
|
|
241
|
-
return isset( $this->get_sanitizing_functions()[ strtolower( $functionName ) ] );
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Check if a particular function is regarded as a sanitizing and unslashing function.
|
|
246
|
-
*
|
|
247
|
-
* @since 3.0.0
|
|
248
|
-
*
|
|
249
|
-
* @param string $functionName The name of the function to check.
|
|
250
|
-
*
|
|
251
|
-
* @return bool
|
|
252
|
-
*/
|
|
253
|
-
final public function is_sanitizing_and_unslashing_function( $functionName ) {
|
|
254
|
-
return isset( $this->get_sanitizing_and_unslashing_functions()[ strtolower( $functionName ) ] );
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Check if something is only being sanitized.
|
|
259
|
-
*
|
|
260
|
-
* @since 0.5.0
|
|
261
|
-
* @since 3.0.0 - Moved from the Sniff class to this class.
|
|
262
|
-
* - The method visibility was changed from `protected` to `public`.
|
|
263
|
-
* - The `$phpcsFile` parameter was added.
|
|
264
|
-
*
|
|
265
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
266
|
-
* @param int $stackPtr The index of the token in the stack.
|
|
267
|
-
*
|
|
268
|
-
* @return bool Whether the token is only within a sanitization.
|
|
269
|
-
*/
|
|
270
|
-
final public function is_only_sanitized( File $phpcsFile, $stackPtr ) {
|
|
271
|
-
$tokens = $phpcsFile->getTokens();
|
|
272
|
-
|
|
273
|
-
// If it isn't being sanitized at all.
|
|
274
|
-
if ( ! $this->is_sanitized( $phpcsFile, $stackPtr ) ) {
|
|
275
|
-
return false;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// If the token isn't in parentheses, we know the value must have only been casted, because
|
|
279
|
-
// is_sanitized() would have returned `false` otherwise.
|
|
280
|
-
if ( ! isset( $tokens[ $stackPtr ]['nested_parenthesis'] ) ) {
|
|
281
|
-
return true;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
// At this point we're expecting the value to have not been casted. If it
|
|
285
|
-
// was, it wasn't *only* casted, because it's also in a function.
|
|
286
|
-
if ( ContextHelper::is_safe_casted( $phpcsFile, $stackPtr ) ) {
|
|
287
|
-
return false;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// The only parentheses should belong to the sanitizing function. If there's
|
|
291
|
-
// more than one set, this isn't *only* sanitization.
|
|
292
|
-
return ( \count( $tokens[ $stackPtr ]['nested_parenthesis'] ) === 1 );
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Check if something is being sanitized.
|
|
297
|
-
*
|
|
298
|
-
* @since 0.5.0
|
|
299
|
-
* @since 3.0.0 - Moved from the Sniff class to this class.
|
|
300
|
-
* - The method visibility was changed from `protected` to `public`.
|
|
301
|
-
* - The `$phpcsFile` parameter was added.
|
|
302
|
-
* - The $require_unslash parameter has been changed from
|
|
303
|
-
* a boolean toggle to a ?callable $unslash_callback parameter to
|
|
304
|
-
* allow a sniff calling this method to handle their "unslashing"
|
|
305
|
-
* related messaging itself.
|
|
306
|
-
*
|
|
307
|
-
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
|
|
308
|
-
* @param int $stackPtr The index of the token in the stack.
|
|
309
|
-
* @param callable|null $unslash_callback Optional. When passed, this method will check if
|
|
310
|
-
* an unslashing function is used on the variable before
|
|
311
|
-
* sanitization and if not, the callback will be called
|
|
312
|
-
* to handle the missing unslashing.
|
|
313
|
-
* The callback will receive the $phpcsFile object and
|
|
314
|
-
* the $stackPtr.
|
|
315
|
-
* When not passed or `null`, this method will **not**
|
|
316
|
-
* check for unslashing issues.
|
|
317
|
-
* Defaults to `null` (skip unslashing checks).
|
|
318
|
-
*
|
|
319
|
-
* @return bool Whether the token is being sanitized.
|
|
320
|
-
*/
|
|
321
|
-
final public function is_sanitized( File $phpcsFile, $stackPtr, $unslash_callback = null ) {
|
|
322
|
-
$tokens = $phpcsFile->getTokens();
|
|
323
|
-
$require_unslash = is_callable( $unslash_callback );
|
|
324
|
-
|
|
325
|
-
if ( isset( $tokens[ $stackPtr ] ) === false ) {
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
// If the variable is just being unset, the value isn't used at all, so it's safe.
|
|
330
|
-
if ( Context::inUnset( $phpcsFile, $stackPtr ) ) {
|
|
331
|
-
return true;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
// First we check if it is being casted to a safe value.
|
|
335
|
-
if ( ContextHelper::is_safe_casted( $phpcsFile, $stackPtr ) ) {
|
|
336
|
-
return true;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// If this isn't within a function call, we know already that it's not safe.
|
|
340
|
-
if ( ! isset( $tokens[ $stackPtr ]['nested_parenthesis'] ) ) {
|
|
341
|
-
if ( $require_unslash ) {
|
|
342
|
-
call_user_func( $unslash_callback, $phpcsFile, $stackPtr );
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
$sanitizing_functions = $this->get_sanitizing_functions();
|
|
349
|
-
$sanitizing_functions += $this->get_sanitizing_and_unslashing_functions();
|
|
350
|
-
$sanitizing_functions += ArrayWalkingFunctionsHelper::get_functions();
|
|
351
|
-
$valid_functions = $sanitizing_functions + UnslashingFunctionsHelper::get_functions();
|
|
352
|
-
|
|
353
|
-
// Get the function that it's in.
|
|
354
|
-
$functionPtr = ContextHelper::is_in_function_call( $phpcsFile, $stackPtr, $valid_functions );
|
|
355
|
-
|
|
356
|
-
// If this isn't a call to one of the valid functions, it sure isn't a sanitizing function.
|
|
357
|
-
if ( false === $functionPtr ) {
|
|
358
|
-
if ( true === $require_unslash ) {
|
|
359
|
-
call_user_func( $unslash_callback, $phpcsFile, $stackPtr );
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
return false;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
$functionName = $tokens[ $functionPtr ]['content'];
|
|
366
|
-
|
|
367
|
-
// Check if an unslashing function is being used.
|
|
368
|
-
$is_unslashed = false;
|
|
369
|
-
if ( UnslashingFunctionsHelper::is_unslashing_function( $functionName ) ) {
|
|
370
|
-
$is_unslashed = true;
|
|
371
|
-
|
|
372
|
-
// Check whether this function call is wrapped within a sanitizing function.
|
|
373
|
-
$higherFunctionPtr = ContextHelper::is_in_function_call( $phpcsFile, $functionPtr, $sanitizing_functions );
|
|
374
|
-
|
|
375
|
-
// If there is no other valid function being used, this value is unsanitized.
|
|
376
|
-
if ( false === $higherFunctionPtr ) {
|
|
377
|
-
return false;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
$functionPtr = $higherFunctionPtr;
|
|
381
|
-
$functionName = $tokens[ $functionPtr ]['content'];
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
// Arrays might be sanitized via an array walking function using a callback.
|
|
385
|
-
if ( ArrayWalkingFunctionsHelper::is_array_walking_function( $functionName ) ) {
|
|
386
|
-
// Get the callback parameter.
|
|
387
|
-
$callback = ArrayWalkingFunctionsHelper::get_callback_parameter( $phpcsFile, $functionPtr );
|
|
388
|
-
|
|
389
|
-
if ( ! empty( $callback ) ) {
|
|
390
|
-
/*
|
|
391
|
-
* If this is a function callback (not a method callback array) and we're able
|
|
392
|
-
* to resolve the function name, do so.
|
|
393
|
-
*/
|
|
394
|
-
$first_non_empty = $phpcsFile->findNext(
|
|
395
|
-
Tokens::$emptyTokens,
|
|
396
|
-
$callback['start'],
|
|
397
|
-
( $callback['end'] + 1 ),
|
|
398
|
-
true
|
|
399
|
-
);
|
|
400
|
-
|
|
401
|
-
if ( false !== $first_non_empty && \T_CONSTANT_ENCAPSED_STRING === $tokens[ $first_non_empty ]['code'] ) {
|
|
402
|
-
$functionName = TextStrings::stripQuotes( $tokens[ $first_non_empty ]['content'] );
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
// If slashing is required, give an error.
|
|
408
|
-
if ( false === $is_unslashed
|
|
409
|
-
&& true === $require_unslash
|
|
410
|
-
&& ! $this->is_sanitizing_and_unslashing_function( $functionName )
|
|
411
|
-
) {
|
|
412
|
-
call_user_func( $unslash_callback, $phpcsFile, $stackPtr );
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
// Check if this is a sanitizing function.
|
|
416
|
-
return ( $this->is_sanitizing_function( $functionName ) || $this->is_sanitizing_and_unslashing_function( $functionName ) );
|
|
417
|
-
}
|
|
418
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Helpers;
|
|
11
|
-
|
|
12
|
-
use PHPCSUtils\BackCompat\Helper;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Helper utilities for checking if a name is in snake_case.
|
|
16
|
-
*
|
|
17
|
-
* ---------------------------------------------------------------------------------------------
|
|
18
|
-
* This class is only intended for internal use by WordPressCS and is not part of the public API.
|
|
19
|
-
* This also means that it has no promise of backward compatibility. Use at your own risk.
|
|
20
|
-
* ---------------------------------------------------------------------------------------------
|
|
21
|
-
*
|
|
22
|
-
* {@internal The functionality in this class will likely be replaced at some point in
|
|
23
|
-
* the future by functions from PHPCSUtils.}
|
|
24
|
-
*
|
|
25
|
-
* @internal
|
|
26
|
-
*
|
|
27
|
-
* @since 3.0.0 The method in this class was previously contained in the
|
|
28
|
-
* `WordPressCS\WordPress\Sniff` class and has been moved here.
|
|
29
|
-
*/
|
|
30
|
-
final class SnakeCaseHelper {
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Transform the name of a PHP construct (function, variable etc) to one in snake_case.
|
|
34
|
-
*
|
|
35
|
-
* @since 2.0.0 Moved from the `WordPress.NamingConventions.ValidFunctionName` sniff
|
|
36
|
-
* to this class, renamed from `get_name_suggestion` and made static
|
|
37
|
-
* so it can also be used by classes which don't extend this class.
|
|
38
|
-
* @since 3.0.0 - Moved from the Sniff class to this class.
|
|
39
|
-
* - Renamed from `get_snake_case_name_suggestion()` to `get_suggestion()`.
|
|
40
|
-
*
|
|
41
|
-
* @param string $name The construct name.
|
|
42
|
-
*
|
|
43
|
-
* @return string
|
|
44
|
-
*/
|
|
45
|
-
public static function get_suggestion( $name ) {
|
|
46
|
-
$suggested = preg_replace( '`(?<!_|^)([A-Z])`', '_$1', $name );
|
|
47
|
-
|
|
48
|
-
if ( preg_match( '`^[a-z0-9_]+$`i', $suggested ) === 1 ) {
|
|
49
|
-
// If the name only contains ASCII characters, we can safely lowercase it.
|
|
50
|
-
$suggested = strtolower( $suggested );
|
|
51
|
-
} elseif ( function_exists( 'mb_strtolower' ) ) {
|
|
52
|
-
$suggested = mb_strtolower( $suggested, Helper::getEncoding() );
|
|
53
|
-
} else {
|
|
54
|
-
// If the name contains non-ASCII chars and Mbstring is not available, only transliterate the ASCII chars.
|
|
55
|
-
$suggested = strtr( $suggested, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' );
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return $suggested;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<?php
|
|
2
|
-
/**
|
|
3
|
-
* WordPress Coding Standard.
|
|
4
|
-
*
|
|
5
|
-
* @package WPCS\WordPressCodingStandards
|
|
6
|
-
* @link https://github.com/WordPress/WordPress-Coding-Standards
|
|
7
|
-
* @license https://opensource.org/licenses/MIT MIT
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
namespace WordPressCS\WordPress\Helpers;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Helper functions and function lists for checking whether a function is an unslashing function.
|
|
14
|
-
*
|
|
15
|
-
* @since 3.0.0 The property in this class was previously contained in the
|
|
16
|
-
* `WordPressCS\WordPress\Sniff` class and has been moved here.
|
|
17
|
-
*/
|
|
18
|
-
final class UnslashingFunctionsHelper {
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Functions which unslash the data passed to them.
|
|
22
|
-
*
|
|
23
|
-
* @since 2.1.0
|
|
24
|
-
* @since 3.0.0 - Moved from the Sniff class to this class.
|
|
25
|
-
* - Visibility changed from protected to private and property made static.
|
|
26
|
-
* Use the `get_functions()` method for access.
|
|
27
|
-
*
|
|
28
|
-
* @var array<string, bool>
|
|
29
|
-
*/
|
|
30
|
-
private static $unslashingFunctions = array(
|
|
31
|
-
'stripslashes_deep' => true,
|
|
32
|
-
'stripslashes_from_strings_only' => true,
|
|
33
|
-
'wp_unslash' => true,
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Retrieve a list of the unslashing functions.
|
|
38
|
-
*
|
|
39
|
-
* @since 3.0.0
|
|
40
|
-
*
|
|
41
|
-
* @return array<string, bool>
|
|
42
|
-
*/
|
|
43
|
-
public static function get_functions() {
|
|
44
|
-
return self::$unslashingFunctions;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Check if a particular function is regarded as a unslashing function.
|
|
49
|
-
*
|
|
50
|
-
* @since 3.0.0
|
|
51
|
-
*
|
|
52
|
-
* @param string $functionName The name of the function to check.
|
|
53
|
-
*
|
|
54
|
-
* @return bool
|
|
55
|
-
*/
|
|
56
|
-
public static function is_unslashing_function( $functionName ) {
|
|
57
|
-
return isset( self::$unslashingFunctions[ strtolower( $functionName ) ] );
|
|
58
|
-
}
|
|
59
|
-
}
|