mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-18 12:35:03 +00:00
Always replace dashes with underscores for keys in get_user_option().
git-svn-id: http://svn.automattic.com/wordpress/trunk@14309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e1fe1b138e
commit
6252553037
@ -238,13 +238,13 @@ function get_user_option( $option, $user = 0, $deprecated = '' ) {
|
|||||||
|
|
||||||
if ( empty($user) ) {
|
if ( empty($user) ) {
|
||||||
$user = wp_get_current_user();
|
$user = wp_get_current_user();
|
||||||
// Keys used as object vars cannot have dashes.
|
|
||||||
$key = str_replace('-', '_', $option);
|
|
||||||
} else {
|
} else {
|
||||||
$user = get_userdata($user);
|
$user = get_userdata($user);
|
||||||
$key = $option;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keys used as object vars cannot have dashes.
|
||||||
|
$key = str_replace('-', '_', $option);
|
||||||
|
|
||||||
if ( isset( $user->{$wpdb->prefix . $key} ) ) // Blog specific
|
if ( isset( $user->{$wpdb->prefix . $key} ) ) // Blog specific
|
||||||
$result = $user->{$wpdb->prefix . $key};
|
$result = $user->{$wpdb->prefix . $key};
|
||||||
elseif ( isset( $user->{$key} ) ) // User specific and cross-blog
|
elseif ( isset( $user->{$key} ) ) // User specific and cross-blog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user