X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fbook%2Fsrc%2FBookOutline.php;fp=web%2Fcore%2Fmodules%2Fbook%2Fsrc%2FBookOutline.php;h=193c20f8fc64a86ab03762581dcacf77560599b2;hp=ec28d50c72012ffd40dc7cc224f5d92ec91d1e40;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/modules/book/src/BookOutline.php b/web/core/modules/book/src/BookOutline.php index ec28d50c7..193c20f8f 100644 --- a/web/core/modules/book/src/BookOutline.php +++ b/web/core/modules/book/src/BookOutline.php @@ -39,12 +39,14 @@ class BookOutline { if ($book_link['pid'] == 0) { return NULL; } - // Assigning the array to $flat resets the array pointer for use with each(). $flat = $this->bookManager->bookTreeGetFlat($book_link); + reset($flat); $curr = NULL; do { $prev = $curr; - list($key, $curr) = each($flat); + $key = key($flat); + $curr = current($flat); + next($flat); } while ($key && $key != $book_link['nid']); if ($key == $book_link['nid']) { @@ -78,10 +80,11 @@ class BookOutline { * $book_link. */ public function nextLink(array $book_link) { - // Assigning the array to $flat resets the array pointer for use with each(). $flat = $this->bookManager->bookTreeGetFlat($book_link); + reset($flat); do { - list($key,) = each($flat); + $key = key($flat); + next($flat); } while ($key && $key != $book_link['nid']); if ($key == $book_link['nid']) {