Skip to content

Commit ae6ae80

Browse files
authored
Merge pull request #2950 from gocodebox/dev
Release 8.0.7
2 parents c9fb204 + abad185 commit ae6ae80

File tree

6 files changed

+22
-16
lines changed

6 files changed

+22
-16
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
LifterLMS Changelog
22
===================
33

4+
v8.0.7 - 2025-06-11
5+
-------------------
6+
7+
##### Security Fixes
8+
9+
+ Additional sanitation of the voucher field.
10+
11+
412
v8.0.6 - 2025-04-21
513
-------------------
614

class-lifterlms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class LifterLMS {
3434
*
3535
* @var string
3636
*/
37-
public $version = '8.0.6';
37+
public $version = '8.0.7';
3838

3939
/**
4040
* LLMS_Assets instance

includes/class.llms.voucher.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ protected function get_codes_table_name() {
7676
global $wpdb;
7777

7878
return $wpdb->prefix . $this->codes_table_name;
79-
8079
}
8180

8281
/**
@@ -90,7 +89,6 @@ protected function get_product_to_voucher_table_name() {
9089

9190
global $wpdb;
9291
return $wpdb->prefix . $this->product_to_voucher_table;
93-
9492
}
9593

9694
/**
@@ -104,7 +102,6 @@ protected function get_redemptions_table_name() {
104102

105103
global $wpdb;
106104
return $wpdb->prefix . $this->redemptions_table;
107-
108105
}
109106

110107
/**
@@ -151,14 +148,17 @@ public function get_voucher_by_code( $code ) {
151148
$table = $this->get_codes_table_name();
152149
$redeemed_table = $this->get_redemptions_table_name();
153150

154-
$query = "SELECT c.*, count(r.id) as used
151+
$sql = $wpdb->prepare(
152+
"SELECT c.*, count(r.id) as used
155153
FROM $table as c
156154
LEFT JOIN $redeemed_table as r
157155
ON c.`id` = r.`code_id`
158-
WHERE `code` = '$code' AND `is_deleted` = 0
159-
GROUP BY c.id
160-
LIMIT 1";
161-
return $wpdb->get_row( $query );
156+
WHERE c.`code` = %s AND c.`is_deleted` = 0
157+
GROUP BY c.`id`
158+
LIMIT 1",
159+
$code
160+
);
161+
return $wpdb->get_row( $sql );
162162
}
163163

164164
/**
@@ -199,7 +199,7 @@ public function get_voucher_code_by_code_id( $code_id ) {
199199

200200
$table = $this->get_codes_table_name();
201201

202-
$query = "SELECT * FROM $table WHERE `id` = $code_id AND `is_deleted` = 0 LIMIT 1";
202+
$query = $wpdb->prepare( 'SELECT * FROM $table WHERE `id` = %d AND `is_deleted` = 0 LIMIT 1', $code_id );
203203
return $wpdb->get_row( $query );
204204
}
205205

@@ -365,7 +365,6 @@ public function use_voucher( $code, $user_id ) {
365365
return $voucher;
366366

367367
}
368-
369368
}
370369

371370
/**
@@ -415,7 +414,6 @@ public function get_redemptions_for_code_by_user( $code_id, $user_id ) {
415414
array( $user_id, $code_id )
416415
)
417416
);
418-
419417
}
420418

421419
/**

lifterlms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Plugin Name: LifterLMS
1111
* Plugin URI: https://lifterlms.com/
1212
* Description: Complete e-learning platform to sell online courses, protect lessons, offer memberships, and quiz students. WP Learning Management System.
13-
* Version: 8.0.6
13+
* Version: 8.0.7
1414
* Author: LifterLMS
1515
* Author URI: https://lifterlms.com/
1616
* Text Domain: lifterlms

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lifterlms",
3-
"version": "8.0.6",
3+
"version": "8.0.7",
44
"description": "LifterLMS by codeBOX",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)