Yaron Koren has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/335748 )
Change subject: Another possible improvement of quote-handling in full-text search ...................................................................... Another possible improvement of quote-handling in full-text search Change-Id: Ib58c2a979fd1dbcf7472b313d727cf2b579493d5 --- M CargoQueryDisplayer.php 1 file changed, 1 insertion(+), 8 deletions(-) Approvals: Yaron Koren: Looks good to me, approved jenkins-bot: Verified diff --git a/CargoQueryDisplayer.php b/CargoQueryDisplayer.php index 6a4da18..30a20f4 100644 --- a/CargoQueryDisplayer.php +++ b/CargoQueryDisplayer.php @@ -268,14 +268,7 @@ foreach ( $terms as $i => $term ) { // Try to map from a MySQL search to a PHP one - // this code could probably be improved. - $term = str_replace( array( '+', '*' ), '', $term ); - // Get rid of quote marks, but only if they're at the - // beginning and end of the string. - $firstChars = substr( $term, 0, 3 ); - $lastChars = substr( $term, -3 ); - if ( ( $firstChars == '\b"' && $lastChars == '"\b' ) || ( $firstChars == "\b'" && $lastChars == "'\b" ) ) { - $term = '\b' . substr( $term, 3, -3 ) . '\b'; - } + $term = str_replace( array( '"', "'", '+', '*' ), '', $term ); // What is the point of this...? if ( strpos( $term, '*' ) !== false ) { $term = '\b' . $term . '\b'; -- To view, visit https://gerrit.wikimedia.org/r/335748 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib58c2a979fd1dbcf7472b313d727cf2b579493d5 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Cargo Gerrit-Branch: master Gerrit-Owner: Yaron Koren <yaro...@gmail.com> Gerrit-Reviewer: Yaron Koren <yaro...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits