PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.47
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.47
1.2.74 1.2.73 1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 All 174 releases
← All changes | includes/helpers/misc.php +6 -87 1.2.701.2.47 View file →
@@ -1457,9 +1457,8 @@
1457 1457 }
1458 1458
1459 1459 function uwp_get_localize_data()
1460 1460 {
1461 - $pass_msg = uwp_get_option("register_uwp_strong_pass_msg");
1462 1461 $uwp_localize_data = array(
1463 1462 'uwp_more_char_limit' => 100,
1464 1463 'uwp_more_text' => __('more', 'userswp'),
1465 1464 'uwp_less_text' => __('less', 'userswp'),
@@ -1470,9 +1469,9 @@
1470 1469 'login_modal' => uwp_get_option("design_style", 'bootstrap') == 'bootstrap' && uwp_get_option("login_modal", 1) ? 1 : '',
1471 1470 'register_modal' => uwp_get_option("design_style", 'bootstrap') == 'bootstrap' && uwp_get_option("register_modal", 1) ? 1 : '',
1472 1471 'forgot_modal' => uwp_get_option("design_style", 'bootstrap') == 'bootstrap' && uwp_get_option("forgot_modal", 1) ? 1 : '',
1473 1472 'uwp_pass_strength' => uwp_get_option("register_min_password_strength", 0),
1474 - 'uwp_strong_pass_msg' => !empty($pass_msg) ? $pass_msg : __("Please enter valid strong password.", "userswp"),
1473 + 'uwp_strong_pass_msg' => uwp_get_option("register_uwp_strong_pass_msg", __("Please enter valid strong password.", "userswp")),
1475 1474 'default_banner' => uwp_get_default_banner_uri(),
1476 1475 'basicNonce' => esc_attr(wp_create_nonce('uwp_basic_nonce'))
1477 1476 );
1478 1477
@@ -1870,17 +1869,13 @@
1870 1869 $key = wp_generate_password(20, false);
1871 1870
1872 1871 do_action('uwp_activation_key', $user_data->user_login, $key);
1873 1872
1874 - if ( function_exists( 'wp_fast_hash' ) ) {
1875 - $hashed = wp_fast_hash( $key );
1876 - } else {
1877 - if ( empty( $wp_hasher ) ) {
1878 - require_once ABSPATH . 'wp-includes/class-phpass.php';
1879 - $wp_hasher = new PasswordHash( 8, true );
1880 - }
1881 - $hashed = $wp_hasher->HashPassword( $key );
1873 + if (empty($wp_hasher)) {
1874 + require_once ABSPATH . 'wp-includes/class-phpass.php';
1875 + $wp_hasher = new PasswordHash(8, true);
1882 1876 }
1877 + $hashed = $wp_hasher->HashPassword($key);
1883 1878 $wpdb->update($wpdb->users, array('user_activation_key' => time() . ":" . $hashed), array('user_login' => $user_data->user_login)); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
1884 1879 update_user_meta($user_id, 'uwp_mod', 'email_unconfirmed');
1885 1880
1886 1881 $activation_args = array(
@@ -1885,9 +1880,9 @@
1885 1880
1886 1881 $activation_args = array(
1887 1882 'uwp_activate' => 'yes',
1888 1883 'key' => $key,
1889 - 'login' => rawurlencode($user_data->user_login)
1884 + 'login' => $user_data->user_login
1890 1885 );
1891 1886
1892 1887 $activation_args = apply_filters('uwp_activation_link_args', $activation_args, $user_id, $user_data);
1893 1888
@@ -2036,81 +2031,5 @@
2036 2031
2037 2032 $display_name = ! empty($user_data->display_name) ? $user_data->display_name : $user_data->user_login;
2038 2033
2039 2034 return apply_filters('uwp_get_username', $display_name, $user_id, $user_data);
2040 -}
2041 -
2042 -/**
2043 - * File relative url.
2044 - *
2045 - * @since 1.2.66
2046 - *
2047 - * @param string $url URL.
2048 - * @param bool $full_path Optional. Full Path. Default false.
2049 - * @return string
2050 - */
2051 -function uwp_get_file_relative_url( $url, $full_path = false ) {
2052 - $url = trim( $url );
2053 -
2054 - if ( !$url ) {
2055 - return $url;
2056 - }
2057 -
2058 - $relative_url = $url;
2059 - $url = trim( $url, '/\\' ); // clean slashes
2060 -
2061 - $upload_dir = wp_upload_dir();
2062 - $upload_basedir = $upload_dir['basedir'];
2063 - $upload_baseurl = $upload_dir['baseurl'];
2064 - $content_dir = untrailingslashit( WP_CONTENT_DIR );
2065 - $content_url = untrailingslashit( WP_CONTENT_URL );
2066 -
2067 - if ( strpos( $upload_baseurl, 'https://' ) === 0 ) {
2068 - $https = 'https://';
2069 - $match_upload_baseurl = str_replace( 'https://', '', $upload_baseurl );
2070 - $content_url = str_replace( 'http://', 'https://', $content_url );
2071 - } else {
2072 - $https = 'http://';
2073 - $match_upload_baseurl = str_replace( 'http://', '', $upload_baseurl );
2074 - $content_url = str_replace( 'https://', 'http://', $content_url );
2075 - }
2076 -
2077 - $match_content_url = strpos( $content_url, 'https://' ) === 0 ? str_replace( 'https://', '', $content_url ) : str_replace( 'http://', '', $content_url );
2078 - $match_url = strpos( $url, 'https://' ) === 0 ? str_replace( 'https://', '', $url ) : str_replace( 'http://', '', $url );
2079 -
2080 - // www.
2081 - $www = '';
2082 - if ( strpos( $match_upload_baseurl, 'www.' ) === 0 ) {
2083 - $www = 'www.';
2084 - $match_upload_baseurl = str_replace( 'www.', '', $match_upload_baseurl );
2085 - }
2086 - if ( strpos( $match_content_url, 'www.' ) === 0 ) {
2087 - $match_content_url = str_replace( 'www.', '', $match_content_url );
2088 - }
2089 - if ( strpos( $match_url, 'www.' ) === 0 ) {
2090 - $match_url = str_replace( 'www.', '', $match_url );
2091 - }
2092 -
2093 - if ( $full_path ) {
2094 - if ( strpos( $relative_url, 'http://' ) === 0 || strpos( $relative_url, 'https://' ) === 0 ) {
2095 - if ( strpos( $match_url, $match_upload_baseurl ) === 0 || strpos( $match_url, $match_content_url ) === 0 ) {
2096 - $relative_url = $https . $www . $match_url;
2097 - }
2098 - } else {
2099 - if ( is_file( $content_dir . '/' . $match_url ) && file_exists( $content_dir . '/' . $match_url ) ) { // url contains content url
2100 - $relative_url = $content_url . '/' . $match_url;
2101 - } elseif ( is_file( $upload_basedir . '/' . $match_url ) && file_exists( $upload_basedir . '/' . $match_url ) ) { // url contains content url
2102 - $relative_url = $upload_baseurl . '/' . $match_url;
2103 - }
2104 - }
2105 - } else {
2106 - if ( strpos( $match_url, $match_upload_baseurl ) === 0 ) { // url contains uploads baseurl
2107 - $relative_url = str_replace( $match_upload_baseurl, '', $match_url );
2108 - } elseif ( strpos( $match_url, $match_content_url ) === 0 ) { // url contains content url
2109 - $relative_url = str_replace( $match_content_url, '', $match_url );
2110 - }
2111 -
2112 - $relative_url = trim( $relative_url, '/\\' );
2113 - }
2114 -
2115 - return apply_filters( 'uwp_get_file_relative_url', $relative_url, $url, $full_path );
2116 2035 }