mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed members search engine;
- fixed get_template function for specific settings at Windows servers;
This commit is contained in:
@@ -178,11 +178,8 @@ if ( ! class_exists( 'UM_Functions' ) ) {
|
||||
|
||||
$path = '';
|
||||
if ( $basename ) {
|
||||
$array = explode( DIRECTORY_SEPARATOR, trim( $basename, DIRECTORY_SEPARATOR ) );
|
||||
$path = $array[0];
|
||||
}
|
||||
if ( substr_count( $path, '/' ) ) {
|
||||
$array = explode( '/', trim( $basename, '/' ) );
|
||||
// use '/' instead of "DIRECTORY_SEPARATOR", because wp_normalize_path makes the correct replace
|
||||
$array = explode( '/', wp_normalize_path( trim( $basename ) ) );
|
||||
$path = $array[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -1182,19 +1182,11 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
$search = trim( $_POST['search'] );
|
||||
if ( ! empty( $search ) ) {
|
||||
|
||||
$identity = '%';
|
||||
preg_match(
|
||||
'/LIKE \'(\{(.*)\})' . esc_attr( $search ) . '(\{(.*)\})\'/im',
|
||||
$sql['where'],
|
||||
$matches
|
||||
);
|
||||
|
||||
if ( ! empty( $matches[1] ) ) {
|
||||
$identity = $matches[1];
|
||||
}
|
||||
$meta_value = '%' . $wpdb->esc_like( $search ) . '%';
|
||||
$search_meta = $wpdb->prepare( '%s', $meta_value );
|
||||
|
||||
preg_match(
|
||||
'/^(.*).meta_value LIKE \'' . $identity . esc_attr( $search ) . $identity . '\' [^\)]/im',
|
||||
'/^(.*).meta_value LIKE ' . addslashes( $search_meta ) . '[^\)]/im',
|
||||
$sql['where'],
|
||||
$join_matches
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user