Skip to content

Commit e3fb93a

Browse files
committed
Add comment explaining isset usage
1 parent 6922989 commit e3fb93a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

phpdotnet/phd/Package/PHP/Web.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ protected function writeJsonIndex() {
232232
$index["sdesc"] = $index["ldesc"];
233233

234234
$parentId = $index['parent_id'];
235+
// isset() to guard against undefined array keys, either for root
236+
// elements (no parent) or in case the index structure is broken.
235237
while (isset($this->indexes[$parentId])) {
236238
$parent = $this->indexes[$parentId];
237239
if ($parent['element'] == 'book') {

0 commit comments

Comments
 (0)