Skip to content

Commit ba39423

Browse files
committed
Additional option exception checks
1 parent 166e2ff commit ba39423

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

index.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
$includeChildren = option('splorp.paperback-export.includeChildren', []);
1414
$excludeTemplate = option('splorp.paperback-export.excludeTemplate', []);
1515

16+
if (! is_string($prefix)) {
17+
throw new Exception('The option “splorp.paperback-export.prefix” must be a string.');
18+
}
19+
if (! is_bool($includeUnlisted)) {
20+
throw new Exception('The option “splorp.paperback-export.includeUnlisted” must be a boolean.');
21+
}
1622
if (! is_array($includeChildren)) {
17-
throw new Exception('The option "splorp.paperback-export.includeChildren" must be an array.');
23+
throw new Exception('The option splorp.paperback-export.includeChildren must be an array.');
1824
}
1925
if (! is_array($excludeTemplate)) {
20-
throw new Exception('The option "splorp.paperback-export.excludeTemplate" must be an array.');
26+
throw new Exception('The option splorp.paperback-export.excludeTemplate must be an array.');
2127
}
2228

2329
$languages = site()->languages();

0 commit comments

Comments
 (0)