Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/wp-includes/rest-api/class-wp-rest-response.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public function add_link( $rel, $href, $attributes = array() ) {
*
* @since 4.4.0
*
* @param string $rel Link relation. Either an IANA registered type, or an absolute URL.
* @param string $href Optional. Only remove links for the relation matching the given href.
* Default null.
* @param string $rel Link relation. Either an IANA registered type, or an absolute URL.
* @param string|null $href Optional. Only remove links for the relation matching the given href.
* Default null.
*/
public function remove_link( $rel, $href = null ) {
if ( ! isset( $this->links[ $rel ] ) ) {
Expand Down
16 changes: 8 additions & 8 deletions src/wp-includes/rest-api/class-wp-rest-server.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ protected function error_to_response( $error ) {
*
* @since 4.4.0
*
* @param string $code WP_Error-style code.
* @param string $message Human-readable message.
* @param int $status Optional. HTTP status code to send. Default null.
* @param string $code WP_Error-style code.
* @param string $message Human-readable message.
* @param int|null $status Optional. HTTP status code to send. Default null.
* @return string JSON representation of the error
*/
protected function json_error( $code, $message, $status = null ) {
Expand Down Expand Up @@ -278,8 +278,8 @@ protected function get_json_encode_options( WP_REST_Request $request ) {
*
* @global WP_User $current_user The currently authenticated user.
*
* @param string $path Optional. The request route. If not set, `$_SERVER['PATH_INFO']` will be used.
* Default null.
* @param string|null $path Optional. The request route. If not set, `$_SERVER['PATH_INFO']` will be used.
* Default null.
* @return null|false Null if not served and a HEAD request, false otherwise.
*/
public function serve_request( $path = null ) {
Expand Down Expand Up @@ -659,7 +659,7 @@ public static function get_response_links( $response ) {
*
* @since 6.7.0
*
* @param array $link
* @param array $link Hints link.
*
* @return array|null
*/
Expand Down Expand Up @@ -763,7 +763,7 @@ public static function get_compact_response_links( $response ) {
* @since 5.4.0 The `$embed` parameter can now contain a list of link relations to include.
*
* @param array $data Data from the request.
* @param bool|string[] $embed Whether to embed all links or a filtered list of link relations.
* @param bool|string[] $embed Whether to embed all links or a filtered list of link relations. Default true.
* @return array {
* Data with sub-requests embedded.
*
Expand Down Expand Up @@ -1341,7 +1341,7 @@ protected function respond_to_request( $request, $route, $handler, $response ) {
protected function get_json_last_error() {
$last_error_code = json_last_error();

if ( JSON_ERROR_NONE === $last_error_code || empty( $last_error_code ) ) {
if ( empty( $last_error_code ) || JSON_ERROR_NONE === $last_error_code ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted in the trac ticket by @khushdoms, this check has been simplified in r60151.

It's causing this file's patch to fail to apply -- I'd suggest removing this particular change, to allow the PR / patch to apply cleanly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

return false;
}

Expand Down
Loading