@@ 320-324 (lines=5) @@ | ||
317 | ||
318 | $errno = json_last_error(); |
|
319 | ||
320 | if ( $errno && function_exists( 'json_last_error' ) ) { |
|
321 | static::handle_json_error( $errno ); |
|
322 | } elseif ( null === $obj && 'null' !== $input ) { |
|
323 | throw new DomainException( 'Null result with non-null input' ); |
|
324 | } |
|
325 | return $obj; |
|
326 | } |
|
327 | ||
@@ 341-345 (lines=5) @@ | ||
338 | $json = wp_json_encode( $input ); |
|
339 | $errno = json_last_error(); |
|
340 | ||
341 | if ( $errno && function_exists( 'json_last_error' ) ) { |
|
342 | static::handle_json_error( $errno ); |
|
343 | } elseif ( 'null' === $json && null !== $input ) { |
|
344 | throw new DomainException( 'Null result with non-null input' ); |
|
345 | } |
|
346 | return $json; |
|
347 | } |
|
348 |