Skip to content

Commit

Permalink
Escape translations.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyskoczilova committed May 3, 2021
1 parent 47f89da commit 7c478c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ You need to install the language first.
== Changelog ==

= 2.0.2 (2021-05-03) =
* Fix CSRF security issues
* Fix security issues
* Check for the empty nonce.
* Escape translations.

= 2.0.1 (2021-05-03) =
* Fix CSRF security issues (thanks @ErwanLR from WPScan for reporting!)
* Fix security issues (thanks @ErwanLR from WPScan for reporting!)
* Check for the empty nonce.
* Check for user permission within ajax request.
* Retrieve current user ID within the request.
Expand Down
4 changes: 2 additions & 2 deletions simple-admin-language-change.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ function change_user_locale_ajax()

// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
if (!isset($_REQUEST['nonce']) || !wp_verify_nonce($_REQUEST['nonce'], "salc_change_user_locale")) {
wp_die( __('Something went wrong, try again.', 'kbnt-sacl'));
wp_die(esc_html(__('Something went wrong, try again.', 'kbnt-sacl')));
}

// Check for permissions matching the user_locale.
if (! current_user_can('edit_posts') || ! current_user_can('edit_pages')) {
wp_die(__('You don\'t have the correct permissions for language change.', 'kbnt-sacl'));
wp_die(esc_html(__('You don\'t have the correct permissions for language change.', 'kbnt-sacl')));
}

$user_id = \get_current_user_id();
Expand Down

0 comments on commit 7c478c0

Please sign in to comment.