Validate regex in string pattern and object patternProperties

[MAILPOET-4195]
This commit is contained in:
Jan Jakes
2022-03-25 10:52:55 +01:00
committed by Veljko V
parent 2bbc086121
commit 2668af08b7
5 changed files with 49 additions and 6 deletions

View File

@@ -23,6 +23,7 @@ class StringSchema extends Schema {
* See: https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/#pattern
*/
public function pattern(string $pattern): self {
$this->validatePattern($pattern);
return $this->updateSchemaProperty('pattern', $pattern);
}