PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
16.3 16.3-beta 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 All 508 releases
← All changes | extensions/blocks/premium-content/_inc/subscription-service/class-jwt.php +6 -4 13.7.2 → 16.3-beta View file →
@@ -12,8 +12,12 @@
12 12 use DomainException;
13 13 use InvalidArgumentException;
14 14 use UnexpectedValueException;
15 15
16 +if ( ! defined( 'ABSPATH' ) ) {
17 + exit( 0 );
18 +}
19 +
16 20 /**
17 21 * JSON Web Token implementation, based on this spec:
18 22 * https://tools.ietf.org/html/rfc7519
19 23 *
@@ -319,9 +323,9 @@
319 323 *
320 324 * @throws DomainException Provided object could not be encoded to valid JSON.
321 325 */
322 326 public static function json_encode( $input ) {
323 - $json = wp_json_encode( $input );
327 + $json = wp_json_encode( $input, JSON_UNESCAPED_SLASHES );
324 328 $errno = json_last_error();
325 329
326 330 if ( $errno ) {
327 331 static::handle_json_error( $errno );
@@ -376,11 +380,9 @@
376 380 JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
377 381 JSON_ERROR_UTF8 => 'Malformed UTF-8 characters',
378 382 );
379 383 throw new DomainException(
380 - isset( $messages[ $errno ] )
381 - ? $messages[ $errno ]
382 - : 'Unknown JSON error: ' . $errno
384 + $messages[ $errno ] ?? 'Unknown JSON error: ' . $errno
383 385 );
384 386 }
385 387
386 388 /**