Skip to content

Commit

Permalink
Merge pull request #392 from 10up/fix/filtering-inactive-active
Browse files Browse the repository at this point in the history
Bugfix: combined queries with q parameter
  • Loading branch information
oscarssanchezz authored May 8, 2024
2 parents b62fd11 + a433191 commit 3113725
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/api/class-bc-cms-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@ public function video_list(
// If Post variables are being escaped, the encoded quote do not return the intended results from the API.
$query = stripslashes( $query );

$args['q'] = sanitize_text_field( $query );

// Per Brightcove API documentation, the query string should have + to play well with combined queries.
// See: https://apis.support.brightcove.com/cms/searching/cms-and-playback-apis-video-search-v2.html
$args['q'] = '+' . sanitize_text_field( $query );
}

if ( isset( $args['q'] ) && false === strpos( $args['q'], 'id:' ) ) {
Expand Down

0 comments on commit 3113725

Please sign in to comment.