From 763b0b689ef0281ab592c3d753c65d158b65b07c Mon Sep 17 00:00:00 2001 From: matt Date: Sat, 4 Aug 2007 03:58:42 +0000 Subject: [PATCH] If no user ID for whatever reason, bail early. git-svn-id: http://svn.automattic.com/wordpress/trunk@5847 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/user.php b/wp-includes/user.php index d81633129e..6de070ab94 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -91,6 +91,9 @@ function get_usermeta( $user_id, $meta_key = '') { global $wpdb; $user_id = (int) $user_id; + if ( !$user_id ) + return false; + if ( !empty($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'");