-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PROD-7928 #4504
PROD-7928 #4504
Conversation
* release: (41 commits) Update: Grunt Update: Grunt string-replace Update: Version name update Update: Language file update grunt Added change log PROD-7988 - pull the API changes PROD-7744 - Update - DB server version instead of server/host PROD-7976 - phpcbf PROD-7976 remove duplicate code logic PROD-7976 Update normalizer code logic PROD-7976 Update normalizer code logic PROD-7933 - Remove welcome videos [PROD-7872] Update mutual connections list styling PROD-7517 - Fixed - If disable all CPT with WP post, then display error PROD-7818 - Split search word and search within title and content for forum, topic and reply PROD-7818 - Fixed - search result inconsistency when search any word within html for topic and reply PROD-7818 - Fixed - search result inconsistency when search any word within html PROD-7517 - Update doc block comment PROD-7860 - Add condition to check activity empty or not ...
@@ -673,20 +673,45 @@ function bp_ps_anyfield_search( $f ) { | |||
|
|||
} | |||
|
|||
if ( in_array( $filter, array( 'contains', 'like' ) ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( in_array( $filter, array( 'contains', 'like' ) ) ) { | |
if ( in_array( $filter, array( 'contains', 'like' ), true ) ) { |
if ( 'like' === $filter ) { | ||
$term = str_replace( '\\\\%', '\\%', $term ); | ||
$term = str_replace( '\\\\_', '\\_', $term ); | ||
$query_placeholder[] = '%' . $term . '%'; | ||
} else { | ||
$query_placeholder[] = '%' . bp_ps_esc_like( $term ) . '%'; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( 'like' === $filter ) { | |
$term = str_replace( '\\\\%', '\\%', $term ); | |
$term = str_replace( '\\\\_', '\\_', $term ); | |
$query_placeholder[] = '%' . $term . '%'; | |
} else { | |
$query_placeholder[] = '%' . bp_ps_esc_like( $term ) . '%'; | |
} | |
if ( 'like' === $filter ) { | |
$term = str_replace( '\\\\%', '\\%', $term ); | |
$term = str_replace( '\\\\_', '\\_', $term ); | |
$query_placeholder[] = '%' . $term . '%'; | |
} else { | |
$query_placeholder[] = '%' . bp_ps_esc_like( $term ) . '%'; | |
} | |
@@ -673,20 +673,45 @@ function bp_ps_anyfield_search( $f ) { | |||
|
|||
} | |||
|
|||
if ( in_array( $filter, array( 'contains', 'like' ) ) ) { | |||
$every_word_clauses = array(); | |||
$query_placeholder = array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$query_placeholder = array();
Move this variable before if ( in_array( $filter, array( 'contains', 'like' ) ) ) {
this condition
- Replaced hardcoded query placeholders with dynamic array handling. - Updated `$wpdb->prepare()` to use spread operator for `$query_placeholder`. - Improved readability by separating `$every_word_clauses` and `$query_placeholder` initialization.
Jira Issue:
https://buddyboss.atlassian.net/browse/PROD-7928
General Note
Keep all conversations related to this PR in the associated Jira issue(s). Do NOT add comment on this PR or edit this PR’s description.
Notes to Developer
Notes to Reviewer