From: Dan Brown Date: Sun, 7 May 2017 18:34:11 +0000 (+0100) Subject: Fixed chapter check for non-mysqlnd instances X-Git-Tag: v0.16.2~1^2 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/75981c24125e3b79945a49dced43645fadb3d9b1 Fixed chapter check for non-mysqlnd instances Fixes #383 --- diff --git a/app/Services/PermissionService.php b/app/Services/PermissionService.php index a1b661533..6f9561a16 100644 --- a/app/Services/PermissionService.php +++ b/app/Services/PermissionService.php @@ -399,7 +399,7 @@ class PermissionService $hasPermissiveAccessToParents = !$book->restricted; // For pages with a chapter, Check if explicit permissions are set on the Chapter - if ($entity->isA('page') && $entity->chapter_id !== 0) { + if ($entity->isA('page') && $entity->chapter_id !== 0 && $entity->chapter_id !== '0') { $chapter = $this->getChapter($entity->chapter_id); $hasPermissiveAccessToParents = $hasPermissiveAccessToParents && !$chapter->restricted; if ($chapter->restricted) {