Skip to content

Commit 3ec336a

Browse files
Merge pull request #24 from razorpay/output-esc-formatting
PO-243 changing escaping for attributes
2 parents e82a050 + 4dd3bb8 commit 3ec336a

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

razorpay-payment-buttons.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Razorpay Payment Button for Elementor
44
* Plugin URI: https://github.com/razorpay/payment-button-elementor-plugin
55
* Description: Razorpay Payment Button for Elementor
6-
* Version: 1.2.6
6+
* Version: 1.2.7
77
* Author: Razorpay
88
* Author URI: https://razorpay.com
99
*/

readme.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: razorpay
33
Tags: Payment gateway, Donate button, UPI/credit/debit card, Payment plugin, India
44
Tested up to: 6.6
5-
Stable tag: 1.2.6
5+
Stable tag: 1.2.7
66
License: GPLv2 or later
77
License URI: http://www.gnu.org/licenses/gpl-2.0.html
88

@@ -96,6 +96,9 @@ Connect your WordPress website with your Razorpay account and you're all ready t
9696

9797
== Changelog ==
9898

99+
= 1.2.7 =
100+
* Added security enhancements
101+
99102
= 1.2.6 =
100103
* Added security enhancements
101104

templates/razorpay-button-view-templates.php

+7-9
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ function razorpay_view_button()
2929
$previous_page_url = admin_url('admin.php?page=razorpay_button_elementor&paged='.$pagenum);
3030
$button_detail = $this->fetch_button_detail(sanitize_text_field($_REQUEST['btn']));
3131

32-
$show = "jQuery('.overlay').show()";
33-
$hide = "jQuery('.overlay').hide()";
3432
echo '<div class="wrap">
3533
<div class="content-header">
36-
<a href="'.$previous_page_url.'">
34+
<a href="' . esc_url($previous_page_url) . '">
3735
<span class="dashicons rzp-dashicons dashicons-arrow-left-alt"></span> Button List
3836
</a>
3937
<span class="dashicons rzp-dashicons dashicons-arrow-right-alt2"></span>'. esc_html($button_detail['title']) . '
@@ -52,12 +50,12 @@ function razorpay_view_button()
5250
<div class="col-sm-4 panel-label">Button Status</div>
5351
<div class="col-sm-8 panel-value">
5452
<span class="status-label">' . esc_html($button_detail['status']) . '</span>
55-
<button onclick="'.$show.'" class="status-button">' . esc_html($button_detail['btn_pointer_status']) . '</button>
53+
<button onclick="jQuery(\'.overlay\').show()" class="status-button">' . esc_html($button_detail['btn_pointer_status']) . '</button>
5654
</div>
5755
</div>
5856
<div class="row">
5957
<div class="col-sm-4 panel-label">Total Quantity Sold</div>
60-
<div class="col-sm-8 panel-value">' . htmlentities($button_detail['total_item_sold']) . '</div>
58+
<div class="col-sm-8 panel-value">' . esc_html($button_detail['total_item_sold']) . '</div>
6159
</div>
6260
<div class="row">
6361
<div class="col-sm-4 panel-label">Total revenue</div>
@@ -85,10 +83,10 @@ function razorpay_view_button()
8583
<p>' . esc_html($button_detail["modal_body_content"]) . '</p>
8684
</div>
8785
<div class="Modal__actions">
88-
<button type="button" onclick="'.$hide.'" class="btn btn-default">No, don`t!</button>
89-
<button type="submit" onclick="'.$hide.'" name="btn_action" value="' . esc_html($button_detail['btn_pointer_status']) . '" class="btn btn-primary">Yes, ' . esc_html($button_detail['btn_pointer_status']) . '</button>
90-
<input type="hidden" name="btn_id" value="' . esc_html($button_detail['id']) . '">
91-
<input type="hidden" name="paged" value="'.$pagenum.'">
86+
<button type="button" onclick="jQuery(\'.overlay\').hide()" class="btn btn-default">No, don`t!</button>
87+
<button type="submit" onclick="jQuery(\'.overlay\').hide()" name="btn_action" value="' . esc_attr($button_detail['btn_pointer_status']) . '" class="btn btn-primary">Yes, ' . esc_html($button_detail['btn_pointer_status']) . '</button>
88+
<input type="hidden" name="btn_id" value="' . esc_attr($button_detail['id']) . '">
89+
<input type="hidden" name="paged" value="' . esc_attr($pagenum) . '">
9290
<input type="hidden" name="action" value="rzp_btn_elementor_action">
9391
</div>
9492
</div>

widget/RazorpayElementsButton.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ protected function content_template()
194194
<# if ( settings.select_button === 'select') { #>
195195
<div class="elementor-counter-title">Please select payment button.</div>
196196
<# } else { #>
197-
<img src=" <?php echo plugin_dir_url(__FILE__).'../public/image/elementorSVG.svg';?>" alt="Razorpay" >
197+
<img src=" <?php echo esc_url(plugin_dir_url(__FILE__).'../public/image/elementorSVG.svg');?>" alt="Razorpay" >
198198
<# } #>
199199
<?php
200200
}

0 commit comments

Comments
 (0)