From eea400f30f9edd08a7ee89ff249ec13230ab9d5b Mon Sep 17 00:00:00 2001 From: Andrew Hancox Date: Tue, 12 Dec 2017 11:53:21 +0000 Subject: [PATCH] Reordered key checks --- classes/core_userkey_manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/core_userkey_manager.php b/classes/core_userkey_manager.php index 2288670..d15ebc8 100644 --- a/classes/core_userkey_manager.php +++ b/classes/core_userkey_manager.php @@ -122,11 +122,11 @@ class core_userkey_manager implements userkey_manager_interface { print_error('expiredkey'); } + $this->validate_ip_address($key); + if (!$user = $DB->get_record('user', array('id' => $key->userid))) { print_error('invaliduserid'); } - - $this->validate_ip_address($key); return $key; }