Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions classic-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,15 @@ public static function save_user_settings( $user_id ) {
if (
isset( $_POST['classic-editor-user-settings'] ) &&
isset( $_POST['classic-editor-replace'] ) &&
wp_verify_nonce( $_POST['classic-editor-user-settings'], 'allow-user-settings' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
wp_verify_nonce( wp_unslash( $_POST['classic-editor-user-settings'] ), 'allow-user-settings' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
) {
$user_id = (int) $user_id;

if ( $user_id !== get_current_user_id() && ! current_user_can( 'edit_user', $user_id ) ) {
return;
}

$editor = self::validate_option_editor( $_POST['classic-editor-replace'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$editor = self::validate_option_editor( wp_unslash( $_POST['classic-editor-replace'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
update_user_option( $user_id, 'classic-editor-settings', $editor );
}
}
Expand Down Expand Up @@ -532,7 +532,7 @@ public static function save_network_settings() {
if (
isset( $_POST['classic-editor-network-settings'] ) &&
current_user_can( 'manage_network_options' ) &&
wp_verify_nonce( $_POST['classic-editor-network-settings'], 'allow-site-admin-settings' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
wp_verify_nonce( wp_unslash( $_POST['classic-editor-network-settings'] ), 'allow-site-admin-settings' ) // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
) {
if ( isset( $_POST['classic-editor-replace'] ) && $_POST['classic-editor-replace'] === 'block' ) {
update_network_option( null, 'classic-editor-replace', 'block' );
Expand Down Expand Up @@ -646,7 +646,7 @@ public static function choose_editor( $use_block_editor, $post ) {
public static function redirect_location( $location ) {
if (
isset( $_REQUEST['classic-editor'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended
( isset( $_POST['_wp_http_referer'] ) && strpos( $_POST['_wp_http_referer'], '&classic-editor' ) !== false ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
( isset( $_POST['_wp_http_referer'] ) && strpos( wp_unslash( $_POST['_wp_http_referer'] ), '&classic-editor' ) !== false ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
) {
$location = add_query_arg( 'classic-editor', '', $location );
}
Expand Down