Services provides a function for this. Better to use that than maintain another reinvented wheel.

@@ -40,8 +39,8 @@ function oauthloginprovider_services_resources() {
 function oauthloginprovider_user_info_action() {
   global $user;
 
-  $data = (array)$user;
-  unset($data['pass']);
+  $data = $user;
+  services_remove_user_data($data);
 
-  return (object)$data;
+  return $data;
 }
CommentFileSizeAuthor
#1 2215715.patch354 bytesmatt2000

Comments

matt2000’s picture

StatusFileSize
new354 bytes

patch

matt2000’s picture

Status: Needs review » Fixed

Release is coming today.

  • Commit 84c0be3 on 7.x-1.x by matt2000:
    #2215715 by matt2000: Use services API function to sanitize user object
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.