]> BookStack Code Mirror - bookstack/commitdiff
Fixed chapter check for non-mysqlnd instances
authorDan Brown <redacted>
Sun, 7 May 2017 18:34:11 +0000 (19:34 +0100)
committerDan Brown <redacted>
Sun, 7 May 2017 18:34:56 +0000 (19:34 +0100)
Fixes #383

app/Services/PermissionService.php

index a1b661533a65df232a3b29987e8e7edfb6d13189..6f9561a161ed0a8dc8ac85f00c317b1d9df23706 100644 (file)
@@ -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) {