From ba394238fe7e7c7bc2078f6e6cb53bc9a3d8786d Mon Sep 17 00:00:00 2001 From: Grant Hutchinson Date: Fri, 15 Jul 2022 14:44:10 -0600 Subject: [PATCH] Additional option exception checks --- index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index d6072f4..5926fff 100755 --- a/index.php +++ b/index.php @@ -13,11 +13,17 @@ $includeChildren = option('splorp.paperback-export.includeChildren', []); $excludeTemplate = option('splorp.paperback-export.excludeTemplate', []); + if (! is_string($prefix)) { + throw new Exception('The option “splorp.paperback-export.prefix” must be a string.'); + } + if (! is_bool($includeUnlisted)) { + throw new Exception('The option “splorp.paperback-export.includeUnlisted” must be a boolean.'); + } if (! is_array($includeChildren)) { - throw new Exception('The option "splorp.paperback-export.includeChildren" must be an array.'); + throw new Exception('The option “splorp.paperback-export.includeChildren” must be an array.'); } if (! is_array($excludeTemplate)) { - throw new Exception('The option "splorp.paperback-export.excludeTemplate" must be an array.'); + throw new Exception('The option “splorp.paperback-export.excludeTemplate” must be an array.'); } $languages = site()->languages();