Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Jan 22, 2024
2 parents 7958a8c + 5b20cc2 commit 47f868c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-badgers-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/headstartwp": patch
---

Ensure htmlspecialchars receives an empty string instead of null to fix deprecation warnings.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions wp/headless-wp/.wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"plugins": [
".",
"../local-plugin",
"https://downloads.wordpress.org/plugin/wordpress-seo.19.14.zip",
"https://downloads.wordpress.org/plugin/safe-redirect-manager.1.11.1.zip"
"https://downloads.wordpress.org/plugin/wordpress-seo.21.8.1.zip",
"https://downloads.wordpress.org/plugin/safe-redirect-manager.2.1.1.zip"
]
}
6 changes: 3 additions & 3 deletions wp/headless-wp/includes/classes/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function modify_rest_params( $args, $request ) {
return $args;
}

$author = htmlspecialchars( filter_input( INPUT_GET, 'author' ) );
$author = htmlspecialchars( filter_input( INPUT_GET, 'author' ) ?? '' );

if ( ! empty( $author ) && ! is_numeric( $author ) ) {
unset( $args['author__in'] );
Expand All @@ -108,10 +108,10 @@ public function modify_rest_params( $args, $request ) {
$taxonomies = wp_list_filter( get_object_taxonomies( $args['post_type'], 'objects' ), [ 'show_in_rest' => true ] );

foreach ( $taxonomies as $taxonomy ) {
$term = htmlspecialchars( filter_input( INPUT_GET, $taxonomy->name ) );
$term = htmlspecialchars( filter_input( INPUT_GET, $taxonomy->name ) ?? '' );

if ( ! $term ) {
$term = htmlspecialchars( filter_input( INPUT_GET, $taxonomy->rest_base ) );
$term = htmlspecialchars( filter_input( INPUT_GET, $taxonomy->rest_base ) ?? '' );
}

if ( ! empty( $term ) && ! is_numeric( $term ) ) {
Expand Down

0 comments on commit 47f868c

Please sign in to comment.