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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user