diff options
Diffstat (limited to 'modules/book/book.pages.inc')
-rw-r--r-- | modules/book/book.pages.inc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc index 583eb7a81..63a1d15a4 100644 --- a/modules/book/book.pages.inc +++ b/modules/book/book.pages.inc @@ -38,6 +38,15 @@ function book_render() { * format determined by the $type parameter. */ function book_export($type, $nid) { + // Check that the node exists and that the current user has access to it. + $node = node_load($nid); + if (!$node) { + return MENU_NOT_FOUND; + } + if (!node_access('view', $node)) { + return MENU_ACCESS_DENIED; + } + $type = drupal_strtolower($type); $export_function = 'book_export_' . $type; |