Skip to content

Commit 849bf45

Browse files
committed
fix: list() and references can cause fatal errors, closes #3491
1 parent 8d6c83d commit 849bf45

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

phpmyfaq/src/phpMyFAQ/Category/Order.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ public function getCategoryTree(array $categories, int $parentId = 0): array
127127
$stack = [[$parentId, &$result]];
128128

129129
while (!empty($stack)) {
130-
list($currentParentId, &$currentResult) = array_pop($stack);
130+
$popped = array_pop($stack);
131+
$currentParentId = $popped[0];
132+
$currentResult = &$popped[1];
131133

132134
foreach ($categories as $category) {
133135
if ((int) $category['parent_id'] === $currentParentId) {

0 commit comments

Comments
 (0)