Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Audit human-readable strings #38

Merged
merged 1 commit into from Dec 14, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/class-wp-json-server.php
Expand Up @@ -173,18 +173,18 @@ public function serve_request( $path = null ) {
$jsonp_enabled = apply_filters( 'json_jsonp_enabled', true );

if ( ! $enabled ) {
echo $this->json_error( 'json_disabled', 'The JSON API is disabled on this site.', 404 );
echo $this->json_error( 'json_disabled', __( 'The JSON API is disabled on this site.' ), 404 );
return false;
}
if ( isset($_GET['_jsonp']) ) {
if ( ! $jsonp_enabled ) {
echo $this->json_error( 'json_callback_disabled', 'JSONP support is disabled on this site.', 400 );
echo $this->json_error( 'json_callback_disabled', __( 'JSONP support is disabled on this site.' ), 400 );
return false;
}

// Check for invalid characters (only alphanumeric allowed)
if ( preg_match( '/\W/', $_GET['_jsonp'] ) ) {
echo $this->json_error( 'json_callback_invalid', 'The JSONP callback function is invalid.', 400 );
echo $this->json_error( 'json_callback_invalid', __( 'The JSONP callback function is invalid.' ), 400 );
return false;
}
}
Expand Down