Skip to content

Commit 1c7183c

Browse files
committed
PageCache/AccessList: Add CIDR support
1 parent ca30c47 commit 1c7183c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function beforeSave()
2424
parent::beforeSave();
2525

2626
$value = $this->getValue();
27-
if (!is_string($value) || !preg_match('/^[\w\s\.\-\,\:]+$/', $value)) {
27+
if (!is_string($value) || !preg_match('/^[\w\s\.\-\,\:(\/\d+)?]+$/', $value)) {
2828
throw new LocalizedException(
2929
new Phrase(
3030
'Access List value "%1" is not valid. '

app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function getValidValues(): array
5252
[null, 'localhost'],
5353
['127.0.0.1', '127.0.0.1'],
5454
['127.0.0.1, localhost, ::2', '127.0.0.1, localhost, ::2'],
55+
['172.16.0.1/24, 2001:0db8:/32', '172.16.0.1/24, 2001:0db8:/32'],
5556
];
5657
}
5758

0 commit comments

Comments
 (0)