Skip to content

Commit

Permalink
Bugfix: combined queries with q parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarssanchez committed May 8, 2024
1 parent b62fd11 commit a433191
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 a433191

Please sign in to comment.