1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

Clarify condition

I want to make it a little more clear that we are checking exactly
for these two values. That may also help preventing further confusion
as to why we are not using empty() here.

Amendment to PR #1033.
This commit is contained in:
Franz Liedke
2017-02-03 18:52:35 +01:00
parent 542bae6277
commit 7c1b0bfcf2

View File

@@ -116,7 +116,7 @@ class RegisterUserHandler
// from the get-go.
if (isset($token)) {
foreach ($token->payload as $k => $v) {
if ($user->$k === '' || ! isset($user->$k)) {
if (in_array($user->$k, ['', null], true)) {
$user->$k = $v;
}
}