File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
app/code/Magento/PageCache/Controller Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ abstract class Block extends \Magento\Framework\App\Action\Action
47
47
*/
48
48
private $ regexValidatorFactory ;
49
49
50
+ /**
51
+ * Validation pattern for handles array
52
+ */
53
+ public const VALIDATION_RULE_PATTERN = '/^[a-z]+[a-z0-9_]*$/i ' ;
54
+
50
55
/**
51
56
* @param \Magento\Framework\App\Action\Context $context
52
57
* @param \Magento\Framework\Translate\InlineInterface $translateInline
@@ -113,8 +118,8 @@ protected function _getBlocks()
113
118
* @param $handles array
114
119
* @return bool
115
120
*/
116
- private function validateHandleParam ($ handles ) {
117
- $ validator = $ this ->regexValidatorFactory ->create (['pattern ' => ' /^[a-z]+[a-z0-9_]*$/i ' ]);
121
+ private function validateHandleParam ($ handles ): bool {
122
+ $ validator = $ this ->regexValidatorFactory ->create (['pattern ' => self :: VALIDATION_RULE_PATTERN ]);
118
123
foreach ($ handles as $ handle ) {
119
124
if (!$ validator ->isValid ($ handle )) {
120
125
return false ;
You can’t perform that action at this time.
0 commit comments