Skip to content

Commit

Permalink
cast to proper types in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPaglusch committed Nov 16, 2024
1 parent d313cfa commit 69fd61e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docker/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
$settings = [
"site_title" => getenv('SITE_TITLE') ?: "FlashPaper :: Self-Destructing Message",
"site_logo" => getenv('SITE_LOGO') ?: "img/logo.svg",
"display_logo" => getenv('DISPLAY_LOGO') ?: "true",
"display_title" => getenv('DISPLAY_TITLE') ?: "false",
"custom_css" => getenv('CUSTOM_CSS') ?: "false",
"display_logo" => filter_var(getenv('DISPLAY_LOGO') ?: "true", FILTER_VALIDATE_BOOLEAN),
"display_title" => filter_var(getenv('DISPLAY_TITLE') ?: "false", FILTER_VALIDATE_BOOLEAN),
"custom_css" => filter_var(getenv('CUSTOM_CSS') ?: "false", FILTER_VALIDATE_BOOLEAN),
"bootstrap_theme" => getenv('BOOTSTRAP_THEME') ?: "flashpaper",
"return_full_url" => getenv('RETURN_FULL_URL') ?: "true",
"return_full_url" => filter_var(getenv('RETURN_FULL_URL') ?: "true", FILTER_VALIDATE_BOOLEAN),
"base_url" => getenv('BASE_URL') ?: "",
"max_secret_length" => getenv('MAX_SECRET_LENGTH') ?: 3000,
"max_secret_length" => (int)(getenv('MAX_SECRET_LENGTH') ?: 3000),
"announcement" => getenv('ANNOUNCEMENT') ?: "",
'prune' => [
'enabled' => getenv('PRUNE_ENABLED') ?: "true",
'min_days' => getenv('PRUNE_MIN_DAYS') ?: 365,
'max_days' => getenv('PRUNE_MAX_DAYS') ?: 730,
'enabled' => filter_var(getenv('PRUNE_ENABLED') ?: "true", FILTER_VALIDATE_BOOLEAN),
'min_days' => (int)(getenv('PRUNE_MIN_DAYS') ?: 365),
'max_days' => (int)(getenv('PRUNE_MAX_DAYS') ?: 730),
],
"messages" => [
"error_secret_too_long" => getenv('MESSAGES_ERROR_SECRET_TOO_LONG') ?: "Input length too long",
Expand Down

0 comments on commit 69fd61e

Please sign in to comment.