-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nonce bypass issue and tested plugin with WordPress version 6.4.4 (…
…#133) * WIP * WIP * Fix nonce bypass issue & Tested with WordPress version 6.4.4 * Fix Style CI
- Loading branch information
Showing
7 changed files
with
52 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -567,17 +567,20 @@ function wpfep_decryption($id) | |
*/ | ||
function wpfep_hide_review_ask() | ||
{ | ||
if (isset($_POST['_wpnonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'wpfep_feedback_action')) { | ||
$ask_review_date = isset($_POST['Ask_Review_Date']) ? sanitize_text_field(wp_unslash($_POST['Ask_Review_Date'])) : ''; | ||
if (isset($_POST['_wpnonce'])) { | ||
if (wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'wpfep_feedback_action')) { | ||
$ask_review_date = isset($_POST['Ask_Review_Date']) ? sanitize_text_field(wp_unslash($_POST['Ask_Review_Date'])) : ''; | ||
|
||
if (get_option('wpfep_Ask_Review_Date') < time() + 3600 * 24 * $ask_review_date) { | ||
update_option('wpfep_Ask_Review_Date', time() + 3600 * 24 * $ask_review_date); | ||
if (get_option('wpfep_Ask_Review_Date') < time() + 3600 * 24 * $ask_review_date) { | ||
update_option('wpfep_Ask_Review_Date', time() + 3600 * 24 * $ask_review_date); | ||
} | ||
} else { | ||
wp_die('Nonce verification failed.'); | ||
} | ||
} else { | ||
wp_die(); | ||
wp_die('Nonce value not set.'); | ||
} | ||
|
||
die(); | ||
} | ||
add_action('wp_ajax_wpfep_hide_review_ask', 'wpfep_hide_review_ask'); | ||
|
||
|
@@ -586,16 +589,20 @@ function wpfep_hide_review_ask() | |
*/ | ||
function wpfep_send_feedback() | ||
{ | ||
if (isset($_POST['_wpnonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'wpfep_feedback_action')) { | ||
$headers = 'Content-type: text/html;charset=utf-8' . "\r\n"; | ||
$feedback = 'Feedback: <br>'; | ||
$feedback .= isset($_POST['Feedback']) ? sanitize_text_field(wp_unslash($_POST['Feedback'])) : ''; | ||
$feedback .= '<br /><br /> site url: <a href=' . site_url() . '>' . site_url() . '</a>'; | ||
$feedback .= '<br />Email Address: '; | ||
$feedback .= isset($_POST['EmailAddress']) ? sanitize_text_field(wp_unslash($_POST['EmailAddress'])) : ''; | ||
wp_mail('[email protected]', 'WP Frontend Profile Plugin Feedback', $feedback, $headers); | ||
if (isset($_POST['_wpnonce'])) { | ||
if (wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'wpfep_feedback_action')) { | ||
$headers = 'Content-type: text/html;charset=utf-8' . "\r\n"; | ||
$feedback = 'Feedback: <br>'; | ||
$feedback .= isset($_POST['Feedback']) ? sanitize_text_field(wp_unslash($_POST['Feedback'])) : ''; | ||
$feedback .= '<br /><br /> site url: <a href=' . site_url() . '>' . site_url() . '</a>'; | ||
$feedback .= '<br />Email Address: '; | ||
$feedback .= isset($_POST['EmailAddress']) ? sanitize_text_field(wp_unslash($_POST['EmailAddress'])) : ''; | ||
wp_mail('[email protected]', 'WP Frontend Profile Plugin Feedback', $feedback, $headers); | ||
} else { | ||
wp_die('Nonce verification failed.'); | ||
} | ||
} else { | ||
wp_die(); | ||
wp_die('Nonce value not set.'); | ||
} | ||
} | ||
add_action('wp_ajax_wpfep_send_feedback', 'wpfep_send_feedback'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters