From d9a3cdbe014feaf324673417556b8e4b7172b162 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 11 Apr 2025 19:38:33 +0000 Subject: [PATCH] Coding Standards: Remove extra check in `WP_REST_Server::get_json_last_error()`. `json_last_error()` can only return an integer, and the `JSON_ERROR_NONE` constant has the value of `0`, so the `empty()` check is redundant here. Follow-up to [34928], [46206]. Props dilipbheda, audrasjb, SergeyBiryukov. See #63249. Built from https://develop.svn.wordpress.org/trunk@60151 git-svn-id: http://core.svn.wordpress.org/trunk@59487 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-server.php | 4 +--- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index 8fe9834a8d..cc633aa253 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -1339,9 +1339,7 @@ class WP_REST_Server { * @return false|string Boolean false or string error message. */ protected function get_json_last_error() { - $last_error_code = json_last_error(); - - if ( JSON_ERROR_NONE === $last_error_code || empty( $last_error_code ) ) { + if ( JSON_ERROR_NONE === json_last_error() ) { return false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 769bc52cd1..39d4458bee 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60150'; +$wp_version = '6.9-alpha-60151'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.