Im working on a flash service connector and i have found one issue in the return values of system.connect.

The original function

function system_service_connect() {
  global $user;

  $return = new stdClass();
  $return->sessid = session_id();
  $return->user = $user;

  return $return ;

}

NULL return values on $user object, thrown an "empty reference error" on my flash lib.
for ex.: timezone is NULL

a workaround to solve this:

function system_service_connect() {
  global $user;
  
  $user_returned = new stdClass();


  foreach ($user as $index => $item){
  if ($item!=NULL){ 
  	$user_returned -> $index  = $item;
  }else {
	
	$user_returned -> $index  = "";
  }
  }

  $return = new stdClass();
  $return->sessid = session_id();
  
  $return->user = $user_returned;

  return $return ;

}

Any other trick to solve this issue?

Comments

snelson’s picture

Status: Active » Postponed (maintainer needs more info)

I've never seen this issue ... can you provide a test Flash file to replicate?

snelson’s picture

Status: Postponed (maintainer needs more info) » Postponed

Postponed due to lack of info.

marcingy’s picture

Status: Postponed » Closed (fixed)

Closed due to lack of response