PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.7
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.7
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | json-endpoints/class.wpcom-json-api-site-settings-endpoint.php +17 -2 16.3-a.1 → 16.3-a.7 View file →
@@ -10,8 +10,10 @@
10 10 if ( ! defined( 'ABSPATH' ) ) {
11 11 exit( 0 );
12 12 }
13 13
14 +require_once dirname( __DIR__ ) . '/modules/verification-tools/verification-tools-utils.php';
15 +
14 16 new WPCOM_JSON_API_Site_Settings_Endpoint(
15 17 array(
16 18 'description' => 'Get detailed settings information about a site.',
17 19 'group' => '__do_not_document',
@@ -645,9 +647,8 @@
645 647
646 648 if ( function_exists( 'wpcom_switch_to_user_locale' ) ) {
647 649 // Compare the locales before/after switch to decide if we should switch back
648 650 $locale_before = determine_locale();
649 - // @phan-suppress-next-line PhanUndeclaredFunction -- Checked above. See also https://github.com/phan/phan/issues/1204.
650 651 wpcom_switch_to_user_locale();
651 652 $switched_locale = determine_locale() !== $locale_before;
652 653 }
653 654
@@ -1233,9 +1234,23 @@
1233 1234 }
1234 1235 break;
1235 1236
1236 1237 case 'verification_services_codes':
1237 - $verification_codes = jetpack_verification_validate( $value );
1238 + foreach ( $value as $raw_code ) {
1239 + if ( '' === $raw_code || null === $raw_code || false === $raw_code ) {
1240 + continue;
1241 + }
1242 +
1243 + if ( false === jetpack_verification_validate_code( $raw_code ) ) {
1244 + return new WP_Error(
1245 + 'invalid_input',
1246 + __( 'Invalid site verification code. Enter a verification code or verification tag.', 'jetpack' ),
1247 + 400
1248 + );
1249 + }
1250 + }
1251 +
1252 + $verification_codes = jetpack_verification_validate_codes( $value );
1238 1253
1239 1254 if ( update_option( 'verification_services_codes', $verification_codes ) ) {
1240 1255 $updated[ $key ] = $verification_codes;
1241 1256 }