Skip to content
Snippets Groups Projects
Commit ee42b4a2 authored by Alexander Opitz's avatar Alexander Opitz Committed by Christian Kuhn
Browse files

[BUGFIX] PHP7.2: Check value for NULL before count

Resolves: #82275
Releases: master, 8.7, 7.6
Change-Id: I77dc811456f4bbd759e28c27284c4652ad09dd23
Reviewed-on: https://review.typo3.org/53938


Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent cbaec8e0
Branches
Tags
No related merge requests found
......@@ -221,11 +221,11 @@ class InlineStackProcessor
protected function calculateStructureLevel($level)
{
$result = false;
$inlineStructureCount = count($this->inlineStructure['stable']);
$structureCount = $this->getStructureDepth();
if ($level < 0) {
$level = $inlineStructureCount + $level;
$level = $structureCount + $level;
}
if ($level >= 0 && $level < $inlineStructureCount) {
if ($level >= 0 && $level < $structureCount) {
$result = $level;
}
return $result;
......@@ -259,6 +259,9 @@ class InlineStackProcessor
*/
public function getStructureDepth()
{
if (!isset($this->inlineStructure['stable']) || !is_array($this->inlineStructure['stable'])) {
return 0;
}
return count($this->inlineStructure['stable']);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment