Form editor fixes
[MAILPOET-1892]
This commit is contained in:
@@ -76,7 +76,7 @@ abstract class Base {
|
|||||||
if (isset($block['params']['label'])
|
if (isset($block['params']['label'])
|
||||||
&& strlen(trim($block['params']['label'])) > 0) {
|
&& strlen(trim($block['params']['label'])) > 0) {
|
||||||
$html .= '<label class="mailpoet_'.$block['type'].'_label">';
|
$html .= '<label class="mailpoet_'.$block['type'].'_label">';
|
||||||
$html .= $block['params']['label'];
|
$html .= htmlspecialchars($block['params']['label']);
|
||||||
|
|
||||||
if (isset($block['params']['required']) && $block['params']['required']) {
|
if (isset($block['params']['required']) && $block['params']['required']) {
|
||||||
$html .= ' <span class="mailpoet_required">*</span>';
|
$html .= ' <span class="mailpoet_required">*</span>';
|
||||||
|
@@ -216,6 +216,9 @@
|
|||||||
)%>
|
)%>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
function encodeHtmlValue(str) {
|
||||||
|
return str.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<').replace(/"/g, '"');
|
||||||
|
}
|
||||||
var mailpoet_segments = <%= json_encode(segments) %>;
|
var mailpoet_segments = <%= json_encode(segments) %>;
|
||||||
|
|
||||||
var mailpoet_default_fields = [
|
var mailpoet_default_fields = [
|
||||||
@@ -658,7 +661,7 @@
|
|||||||
|
|
||||||
mailpoet_form_fields();
|
mailpoet_form_fields();
|
||||||
MailPoet.Notice.success(
|
MailPoet.Notice.success(
|
||||||
"<%= __('Removed custom field %$1s') | escape('js') %>".replace('%$1s', '"' + name + '"')
|
"<%= __('Removed custom field %$1s') | escape('js') %>".replace('%$1s', '"' + encodeHtmlValue(name) + '"')
|
||||||
);
|
);
|
||||||
|
|
||||||
MailPoet.trackEvent('Forms > Delete custom field', {
|
MailPoet.trackEvent('Forms > Delete custom field', {
|
||||||
|
@@ -96,11 +96,11 @@
|
|||||||
|
|
||||||
if(data.id) {
|
if(data.id) {
|
||||||
MailPoet.Notice.success(
|
MailPoet.Notice.success(
|
||||||
"<%= __('Updated custom field %$1s') | escape('js') %>".replace('%$1s', '"' + data.name + '"')
|
"<%= __('Updated custom field %$1s') | escape('js') %>".replace('%$1s', '"' + encodeHtmlValue(data.name) + '"')
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
MailPoet.Notice.success(
|
MailPoet.Notice.success(
|
||||||
"<%= __('Added custom field %$1s') | escape('js') %>".replace('%$1s', '"' + data.name + '"')
|
"<%= __('Added custom field %$1s') | escape('js') %>".replace('%$1s', '"' + encodeHtmlValue(data.name) + '"')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}).fail(function(response) {
|
}).fail(function(response) {
|
||||||
|
Reference in New Issue
Block a user