]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/ExportService.php
Fixed issue where restricted page content in plaintext export
[bookstack] / app / Entities / ExportService.php
index f945dfbe4afe1d17246ca7119c6e776c4acf0455..508670c850828265bf7a8dd2b7d94082d7335fcf 100644 (file)
@@ -203,7 +203,7 @@ class ExportService
     {
         $text = $chapter->name . "\n\n";
         $text .= $chapter->description . "\n\n";
-        foreach ($chapter->pages as $page) {
+        foreach ($chapter->getVisiblePages() as $page) {
             $text .= $this->pageToPlainText($page);
         }
         return $text;
@@ -214,7 +214,7 @@ class ExportService
      */
     public function bookToPlainText(Book $book): string
     {
-        $bookTree = (new BookContents($book))->getTree(false, true);
+        $bookTree = (new BookContents($book))->getTree(false, false);
         $text = $book->name . "\n\n";
         foreach ($bookTree as $bookChild) {
             if ($bookChild->isA('chapter')) {