PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
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 13.9.2 14.0.1 All 504 releases
← All changes | modules/wpcom-tos/wpcom-tos.php +8 -5 13.7.216.3-a.1 View file →
@@ -10,8 +10,12 @@
10 10 namespace Automattic\Jetpack\TOS;
11 11
12 12 use Automattic\Jetpack\Connection\Client;
13 13
14 +if ( ! defined( 'ABSPATH' ) ) {
15 + exit( 0 );
16 +}
17 +
14 18 /**
15 19 * Makes a request to the WP.com legal endpoint to mark the Terms of Service as accepted.
16 20 */
17 21 function accept_tos() {
@@ -28,14 +32,13 @@
28 32 )
29 33 );
30 34
31 35 if ( is_wp_error( $response ) ) {
32 - wp_send_json_error( array( 'message' => __( 'Could not accept the Terms of Service. Please try again later.', 'jetpack' ) ) );
33 - wp_die();
36 + // @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- It takes null, but its phpdoc only says int.
37 + wp_send_json_error( array( 'message' => __( 'Could not accept the Terms of Service. Please try again later.', 'jetpack' ) ), null, JSON_UNESCAPED_SLASHES );
34 38 }
35 39
36 - wp_send_json_success( $response );
37 -
38 - wp_die();
40 + // @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- It takes null, but its phpdoc only says int.
41 + wp_send_json_success( $response, null, JSON_UNESCAPED_SLASHES );
39 42 }
40 43
41 44 add_action( 'wp_ajax_jetpack_accept_tos', __NAMESPACE__ . '\accept_tos' );