Skip to content

Commit 5e655f9

Browse files
authored
WPCOM_JSON_API_Endpoint document(): Prevent warning when fetching the rest_api_documentation row returns no results (#35173)
* WPCOM_JSON_API_Endpoint document(): Prevent warning when fetching the rest_api_documentation row returns no results * changelog
1 parent dc12aef commit 5e655f9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: other
3+
4+
WPCOM_JSON_API_Endpoint document(): Prevent warning when fetching the rest_api_documentation row returns no results

projects/plugins/jetpack/class.json-api-endpoints.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ public function document( $show_description = true ) {
10841084
<?php
10851085
$requires_auth = $wpdb->get_row( $wpdb->prepare( 'SELECT requires_authentication FROM rest_api_documentation WHERE `version` = %s AND `path` = %s AND `method` = %s LIMIT 1', $version, untrailingslashit( $doc['path_labeled'] ), $doc['method'] ) );
10861086
?>
1087-
<td class="type api-index-item-title"><?php echo ( true === (bool) $requires_auth->requires_authentication ? 'Yes' : 'No' ); ?></td>
1087+
<td class="type api-index-item-title"><?php echo ( ! empty( $requires_auth->requires_authentication ) ? 'Yes' : 'No' ); ?></td>
10881088
</tr>
10891089

10901090
</tbody>

0 commit comments

Comments
 (0)