PluginProbe
Responsive Menu – Mobile Menu & Hamburger Menu Builder / 4.7.4
Responsive Menu – Mobile Menu & Hamburger Menu Builder v4.7.4
4.7.4 4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 All 91 releases
← All changes | v4.0.0/inc/classes/class-admin.php +8 -0 4.1.9 → 4.7.4 View file →
@@ -579,8 +579,16 @@
579 579
580 580 $file_contents = isset( $_FILES['file']['tmp_name'] ) ? $wp_filesystem->get_contents( wp_unslash( $_FILES['file']['tmp_name'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
581 581 $import_options = json_decode( $file_contents, true );
582 582
583 + if ( ! is_array( $import_options ) ) {
584 + wp_send_json_error( array( 'message' => __( 'Invalid import file format!', 'responsive-menu' ) ) );
585 + }
586 +
587 + // Sanitize all imported options — treat imported JSON as untrusted input.
588 + // Use the same sanitization as the normal save path (rm_sanitize_rec_array with HTML allowed).
589 + $import_options = rm_sanitize_rec_array( $import_options, true );
590 +
583 591 $option_manager = Option_Manager::get_instance();
584 592 $exist_option = $option_manager->get_options( $menu_id );
585 593
586 594 // Some required options replced in imported settings with existing menu settings.