Review main Abandoned

67174[BUGFIX] Avoid PHP warning in Extbase Session->hasIdentifier

Claus Due CR 0 V 0 Easy +2 −1 updated 12/18/20, 12:54

Commit message

When Session->hasIdentifier() is called but no instance of
$className has yet been fetched, a PHP warning about
illegal offset type is triggered. This happens because the
isset() check passes:

    $this->identifierMap[$this->getClassIdentifier($className)][$identifier]

But because $this->identifierMap[$this->getClassIdentifier($className)]
in this case is NULL, the reference attempts to access
`null[$identifier]` which is of course not valid.

The problem is prevented by splitting the checked
variable reference into two arguments for isset(),
which in turn returns early if the first of the two
arguments is not set. This prevents the check for
an array key being set on a null value, causing
the PHP warning to no longer be triggered.

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 1