]> BookStack Code Mirror - bookstack/commitdiff
Prevent page redirect on draft saving
authorDan Brown <redacted>
Fri, 10 Jun 2016 18:45:53 +0000 (19:45 +0100)
committerDan Brown <redacted>
Fri, 10 Jun 2016 18:45:53 +0000 (19:45 +0100)
Only an issue when using the non 'mysqlnd' extension.
Fixes #120

app/Http/Controllers/PageController.php

index da927374332c9ccecfc600a3355f9d5f16d6f47a..23006888418e490521c51620f92c850ca5a1a683 100644 (file)
@@ -92,7 +92,7 @@ class PageController extends Controller
 
         $draftPage = $this->pageRepo->getById($pageId, true);
 
-        $chapterId = $draftPage->chapter_id;
+        $chapterId = intval($draftPage->chapter_id);
         $parent = $chapterId !== 0 ? $this->chapterRepo->getById($chapterId) : $book;
         $this->checkOwnablePermission('page-create', $parent);