Fix CustomHtml block class

[MAILPOET-6287]
This commit is contained in:
Pavel Dohnal
2024-10-18 12:29:36 +02:00
committed by Rostislav Wolný
parent c3df5d4685
commit ebcfca9a56
4 changed files with 14 additions and 4 deletions

View File

@@ -216,10 +216,11 @@ class BlockRendererHelper {
// return field name depending on block data
public function getFieldName(array $block = []): string {
if ((int)$block['id'] > 0) {
return 'cf_' . $block['id'];
$blockId = $this->wp->escAttr($block['id']);
if ((int)$blockId > 0) {
return 'cf_' . $blockId;
} elseif (isset($block['params']['obfuscate']) && !$block['params']['obfuscate']) {
return $block['id'];
return $blockId;
} else {
return $this->fieldNameObfuscator->obfuscate($block['id']);//obfuscate field name for spambots
}