Fix pregs. Props Mordred.
git-svn-id: https://develop.svn.wordpress.org/trunk@4582 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7b8f7aedc1
commit
5f4d74ee74
@ -81,7 +81,7 @@ function get_usermeta( $user_id, $meta_key = '') {
|
||||
$user_id = (int) $user_id;
|
||||
|
||||
if ( !empty($meta_key) ) {
|
||||
$meta_key = preg_replace('|a-z0-9_|i', '', $meta_key);
|
||||
$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
|
||||
$metas = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'");
|
||||
} else {
|
||||
$metas = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id'");
|
||||
|
@ -165,7 +165,7 @@ break;
|
||||
|
||||
case 'resetpass' :
|
||||
case 'rp' :
|
||||
$key = preg_replace('/a-z0-9/i', '', $_GET['key']);
|
||||
$key = preg_replace('/[^a-z0-9]/i', '', $_GET['key']);
|
||||
if ( empty( $key ) ) {
|
||||
wp_redirect('wp-login.php?action=lostpassword&error=invalidkey');
|
||||
exit();
|
||||
|
Loading…
Reference in New Issue
Block a user