Skip to content

Commit 9b31f78

Browse files
author
Ivan Chaplygin
committed
Updated translations
Fixed HTML elements output Fixed parameters retrieval
1 parent b525b1b commit 9b31f78

File tree

7 files changed

+16
-8
lines changed

7 files changed

+16
-8
lines changed

src/include/abstracts/class-wc-retailcrm-abstracts-settings.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,18 +804,20 @@ public function generate_button_html($key, $data)
804804

805805
$data = wp_parse_args($data, $defaults);
806806

807+
$allowed_tags = ['span' => ['class' => true, 'tabindex' => true, 'aria-label' => true, 'data-tip' => true]];
808+
807809
ob_start();
808810
?>
809811
<tr valign="top">
810812
<th scope="row" class="titledesc">
811813
<label for="<?php echo esc_attr($field); ?>"><?php echo wp_kses_post($data['title']); ?></label>
812-
<?php echo esc_attr($this->get_tooltip_html($data)); ?>
814+
<?php echo wp_kses($this->get_tooltip_html($data), $allowed_tags); ?>
813815
</th>
814816
<td class="forminp">
815817
<fieldset>
816818
<legend class="screen-reader-text"><span><?php echo wp_kses_post($data['label']); ?></span></legend>
817819
<button id="<?php echo esc_attr($data['id']); ?>" class="<?php echo esc_attr($data['class']); ?>" type="button" name="<?php echo esc_attr($field); ?>" id="<?php echo esc_attr($field); ?>" style="<?php echo esc_attr($data['css']); ?>" <?php echo esc_attr($this->get_custom_attribute_html($data)); ?>><?php echo wp_kses_post($data['label']); ?></button>
818-
<?php echo esc_attr($this->get_description_html($data)); ?>
820+
<?php echo wp_kses($this->get_description_html($data), $allowed_tags); ?>
819821
</fieldset>
820822
</td>
821823
</tr>
@@ -863,10 +865,12 @@ public function generate_heading_html($key, $data)
863865
public function validate_online_assistant_field($key, $value)
864866
{
865867
$onlineAssistant = $_POST['woocommerce_integration-retailcrm_online_assistant']
866-
? sanitize_text_field(wp_unslash($_POST['woocommerce_integration-retailcrm_online_assistant']))
868+
? wp_unslash($_POST['woocommerce_integration-retailcrm_online_assistant'])
867869
: ''
868870
;
869871

872+
sanitize_text_field($_POST['woocommerce_integration-retailcrm_online_assistant']);
873+
870874
if ($onlineAssistant === '') {
871875
return '';
872876
}

src/include/class-wc-retailcrm-base.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ public function retailcrm_coupon_info()
952952
'onclick' => true,
953953
],
954954
'b' => [],
955-
'i' => ['style' => true],
955+
'i' => ['style' => true, 'id' => true, 'onclick' => true],
956956
'u' => [],
957957
]);
958958
}
@@ -1343,7 +1343,7 @@ public function retailcrm_show_loyalty()
13431343
'a' => ['id' => true, 'class' => true, 'href' => true, 'target' => true],
13441344
'div' => ['id' => true, 'class' => true],
13451345
'br' => [],
1346-
'table' => ['style' => true, 'border' => true],
1346+
'table' => ['style' => true],
13471347
'tbody' => ['style' => true],
13481348
'tr' => ['style' => true],
13491349
'td' => ['style' => true]

src/include/class-wc-retailcrm-ga.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ public function send_analytics() {
7676
return $js;
7777
}
7878

79-
$order_id = wc_get_order_id_by_order_key(sanitize_text_field(wp_unslash($_GET['key'])));
79+
$order_id = wc_get_order_id_by_order_key(wp_unslash($_GET['key']));
8080
$order = wc_get_order($order_id);
8181

82+
sanitize_text_field($_GET['key']);
83+
8284
if (is_object($order) === false) {
8385
return $js;
8486
}

src/include/class-wc-retailcrm-uploader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public function __construct($retailcrm, $orders, $customers)
5959
*/
6060
public function uploadSelectedOrders()
6161
{
62-
$ids = $_GET['order_ids_retailcrm'] ? sanitize_text_field(wp_unslash($_GET['order_ids_retailcrm'])) : [];
62+
$ids = $_GET['order_ids_retailcrm'] ? wp_unslash($_GET['order_ids_retailcrm']) : [];
63+
64+
sanitize_text_field($_GET['order_ids_retailcrm']);
6365

6466
WC_Retailcrm_Logger::info(__METHOD__, 'Selected order IDs: ' . json_encode($ids));
6567

src/include/components/class-wc-retailcrm-loyalty-form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function getInfoLoyalty(array $loyaltyAccount)
130130
$data[] = '<b style="font-size: 100%">' . esc_html__('History', 'woo-retailcrm') . '</b>';
131131

132132
$htmlTable = '
133-
<table style="width: 75%; border: none;>
133+
<table style="width: 75%; border: none;">
134134
<tbody>';
135135

136136
foreach ($loyaltyAccount['history'] as $operation) {
288 Bytes
Binary file not shown.
326 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)