1
0
mirror of https://github.com/php/phd.git synced 2026-03-23 22:52:05 +01:00

Fix: Prevent using null as array offset in Package/PHP/Web (#228)

* Fix: Stop using null as array offset (Resolves #227)

* This also avoids accessing "path" on a null source when sourceInfo() returns null.

---------

Co-authored-by: lacatoire <louis-arnaud.catoire@external.drivalia.com>
This commit is contained in:
Louis-Arnaud
2026-01-11 21:32:45 +01:00
committed by GitHub
parent 43855fa7b2
commit 91384413a2

View File

@@ -204,7 +204,14 @@ $PARENTS = ' . var_export($parents, true) . ';';
"alternatives" => $this->cchunk["alternatives"],
"source" => $this->sourceInfo($id),
);
$setup["history"] = $this->history[$setup["source"]["path"]] ?? [];
$history = $this->history ?? [];
$sourcePath = $setup["source"]["path"] ?? null;
$setup["history"] = $sourcePath !== null
? ($history[$sourcePath] ?? [])
: [];
if ($this->getChildren($id)) {
$lang = $this->config->language;
$setup["extra_header_links"] = array(