Add escaping for known shortcodes when rendered in form textarea's value
[MAILPOET-5243]
This commit is contained in:
committed by
Aschepikov
parent
fb2c839fad
commit
e62a3ee5b5
@@ -258,6 +258,15 @@ class BlockRendererHelper {
|
||||
return join(' ', $modifiers);
|
||||
}
|
||||
|
||||
public function escapeShortCodes(?string $value): ?string {
|
||||
if ($value === null) {
|
||||
return null;
|
||||
}
|
||||
return preg_replace_callback('/' . $this->wp->getShortcodeRegex() . '/s', function ($matches) {
|
||||
return str_replace(['[', ']'], ['[', ']'], $matches[0]);
|
||||
}, $value);
|
||||
}
|
||||
|
||||
private function translateValidationErrorMessage(string $validate): string {
|
||||
switch ($validate) {
|
||||
case 'email':
|
||||
|
Reference in New Issue
Block a user