Skip to content

Commit aad73a5

Browse files
authored
gw-draft-resume-change-notice.php: Added new snippet that displays a notice when a user resumes draft from a new IP/UA.
1 parent ba8fb22 commit aad73a5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gravity-forms/gw-draft-resume-change-notice.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@
1414

1515
global $wpdb;
1616
$table = GFFormsModel::get_draft_submissions_table_name();
17-
17+
1818
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
1919
$draft = $wpdb->get_row(
2020
$wpdb->prepare(
21-
"SELECT form_id, ip, submission FROM {$table} WHERE uuid = %s",
22-
$token
21+
sprintf(
22+
"SELECT form_id, ip, submission FROM `%s` WHERE uuid = %%s",
23+
esc_sql( $table )
24+
),
25+
$uuid
2326
)
2427
);
2528

@@ -47,7 +50,7 @@
4750
return $form_markup;
4851
}
4952

50-
// Configure Messages
53+
// Configure Messages
5154
$ip_changed_message = '🌍 Your location has changed since last editing this draft';
5255
$browser_changed_message = '💻 Your browser or device has changed since last editing this draft';
5356
$both_changed_message = '🔒 Your location AND device have both changed since last editing this draft';

0 commit comments

Comments
 (0)