We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ab767e9 + 226699e commit 3cd59cfCopy full SHA for 3cd59cf
1 file changed
mu-plugins/osi-api/osi-api.php
@@ -136,13 +136,10 @@ public function get_licenses( WP_REST_Request $data ) {
136
137
$args['post_title_like'] = sanitize_text_field( $searched_slug ); // Use the post name (slug) to filter by ID
138
} elseif ( ! empty( $spdx ) ) {
139
- // Cast the term to a regex pattern
140
- $regex = $this->cast_wildcard_to_regex( $spdx );
141
-
142
// If we have no wildcards, look for a direct match
143
$args['meta_query'][] = array(
144
'key' => 'spdx_identifier_display_text',
145
- 'value' => $regex,
+ 'value' => str_contains( $spdx, '*' ) ? $this->cast_wildcard_to_regex( $spdx ) : sanitize_text_field( $spdx ),
146
'compare' => str_contains( $spdx, '*' ) ? 'REGEXP' : '==',
147
);
148
} elseif ( ! empty( $keyword ) ) {
0 commit comments