- fixed members search engine;

- fixed get_template function for specific settings at Windows servers;
This commit is contained in:
nikitasinelnikov
2019-10-21 15:43:30 +03:00
parent 91048da275
commit 88f586ff11
2 changed files with 5 additions and 16 deletions
+2 -5
View File
@@ -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];
}
+3 -11
View File
@@ -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
);