Can somebody explain me why that ternary operetor return the second option instead of the first ?
This is the code :
$token_sid =
($user->data['user_id'] == ANONYMOUS &&
!empty($config['form_token_sid_guests'])) ? $user->session_id : '';
And here are the values for my actual testing
$user->data['user_id'] = 36412
ANONYMOUS = 1
$config['form_token_sid_guests'] = 0
$user->session_id = 4c148b664b7284ecb776c0a932ddf008
$token_sid = ''
Any idea why that return the empty value instead of the user session id ?
is not equal to
(36412 != 1)
So the first “AND”-Condition failes and your else-“Block” will be evaluated.