Please use my patch to treat UTF-8 Japanese
-
I try the plugin to search UTF-8 Japanese. But the result was unstable.
One word is ok, but another word return no result.
I checked the code, then found preg_split and “u” options not using.
—
— C:/temp/custom-fields-search.php-rev1549.svn000.tmp.php 火 11 14 15:22:31 2017
+++ D:/data/wordpress_customfieldsearch/custom-fields-search.php 火 11 14 15:26:46 2017
@@ -167,7 +167,7 @@
}$user_request = esc_sql( trim( $wp_query->query_vars[‘s’] ) );
– $user_request_arr = preg_split( “/[\s,]+/”, $user_request ); /* The user’s regular expressions are used to separate array for the desired keywords */
+ $user_request_arr = preg_split( “/[\s,]+/u”, $user_request ); /* The user’s regular expressions are used to separate array for the desired keywords */if ( ! empty( $cstmfldssrch_options[‘fields’] ) ) {
$cusfields_sql_request = “‘” . implode( “‘, ‘”, $cstmfldssrch_options[‘fields’] ) . “‘”; /* forming a string with the list of meta_key, which user has selected */
- The topic ‘Please use my patch to treat UTF-8 Japanese’ is closed to new replies.