PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | admin/import/class-import-settings.php +12 -2 18.228.5 View file →
@@ -16,9 +16,9 @@
16 16 * Nonce action key.
17 17 *
18 18 * @var string
19 19 */
20 - const NONCE_ACTION = 'wpseo-import-settings';
20 + public const NONCE_ACTION = 'wpseo-import-settings';
21 21
22 22 /**
23 23 * Holds the import status instance.
24 24 *
@@ -51,9 +51,15 @@
51 51 if ( ! WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ) ) {
52 52 return;
53 53 }
54 54
55 - $content = filter_input( INPUT_POST, 'settings_import' );
55 + if ( ! isset( $_POST['settings_import'] ) || ! is_string( $_POST['settings_import'] ) ) {
56 + return;
57 + }
58 +
59 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: The raw content will be parsed afterwards.
60 + $content = wp_unslash( $_POST['settings_import'] );
61 +
56 62 if ( empty( $content ) ) {
57 63 return;
58 64 }
59 65
@@ -84,8 +90,10 @@
84 90 *
85 91 * @param string $name Name string.
86 92 * @param array $option_group Option group data.
87 93 * @param array $options Options data.
94 + *
95 + * @return void
88 96 */
89 97 protected function parse_option_group( $name, $option_group, $options ) {
90 98 // Make sure that the imported options are cleaned/converted on import.
91 99 $option_instance = WPSEO_Options::get_option_instance( $name );
@@ -97,8 +105,10 @@
97 105 /**
98 106 * Imports the options if found.
99 107 *
100 108 * @param array $options The options parsed from the provided settings.
109 + *
110 + * @return void
101 111 */
102 112 protected function import_options( $options ) {
103 113 if ( isset( $options['wpseo']['version'] ) && $options['wpseo']['version'] !== '' ) {
104 114 $this->old_wpseo_version = $options['wpseo']['version'];