| @@ -1,15 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Renders a JSON of records. | |
| 4 | - * | |
| 5 | - * @package WP_Stream | |
| 6 | - * | |
| 7 | - * @var $records | |
| 8 | - */ | |
| 9 | - | |
| 10 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 11 | - exit; | |
| 2 | +header( 'Content-type: application/json; charset=' . get_option( 'blog_charset' ), true ); | |
| 3 | +if ( version_compare( PHP_VERSION, '5.4', '<' ) ) { | |
| 4 | + echo wp_stream_json_encode( $records ); // xss ok | |
| 5 | +} else { | |
| 6 | + echo wp_stream_json_encode( $records, JSON_PRETTY_PRINT ); // xss ok | |
| 12 | 7 | } |
| 13 | - | |
| 14 | -header( 'Content-type: application/json; charset=' . get_option( 'blog_charset' ), true ); | |
| 15 | -echo wp_json_encode( $records, JSON_PRETTY_PRINT ); | |