Skip to content

Commit cf06313

Browse files
committed
AC-7025 - Sanitize input handler parameter
1 parent 138ca0b commit cf06313

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/NewAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class NewAction extends \Magento\Catalog\Controller\Adminhtml\Product implements
3535
/**
3636
* @var RegexValidator
3737
*/
38-
public RegexValidator $regexValidator;
38+
private RegexValidator $regexValidator;
3939

4040
/**
4141
* @param Context $context

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/NewActionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function testExecute(string $value, bool $exceptionThrown): void
144144
->with($value)
145145
->willReturn(true);
146146

147-
$this->assertEquals(true, $this->action->regexValidator->validateParamRegex($value));
147+
$this->assertEquals(true, $this->regexValidator->validateParamRegex($value));
148148
}
149149
}
150150

lib/internal/Magento/Framework/RegexValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(
4040
* @param string $pattern
4141
* @return bool
4242
*/
43-
public function validateParamRegex($params, $pattern = self::VALIDATION_RULE_PATTERN)
43+
public function validateParamRegex(string $params, string $pattern = self::VALIDATION_RULE_PATTERN): bool
4444
{
4545
$validator = $this->regexValidatorFactory->create(['pattern' => $pattern]);
4646

0 commit comments

Comments
 (0)