Skip to content

Commit

Permalink
Merge pull request #35 from oldskool/fluxbb-1.4
Browse files Browse the repository at this point in the history
#652: Negative option values leading to various strange situations
  • Loading branch information
franzliedke committed Apr 3, 2012
2 parents 3e5349e + f68c8bd commit cf41ab6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions admin_options.php
Expand Up @@ -34,20 +34,20 @@
'default_style' => pun_trim($_POST['form']['default_style']),
'time_format' => pun_trim($_POST['form']['time_format']),
'date_format' => pun_trim($_POST['form']['date_format']),
'timeout_visit' => intval($_POST['form']['timeout_visit']),
'timeout_online' => intval($_POST['form']['timeout_online']),
'redirect_delay' => intval($_POST['form']['redirect_delay']),
'timeout_visit' => (intval($_POST['form']['timeout_visit']) > 0) ? intval($_POST['form']['timeout_visit']) : 1,
'timeout_online' => (intval($_POST['form']['timeout_online']) > 0) ? intval($_POST['form']['timeout_online']) : 1,
'redirect_delay' => (intval($_POST['form']['redirect_delay']) >= 0) ? intval($_POST['form']['redirect_delay']) : 0,
'show_version' => $_POST['form']['show_version'] != '1' ? '0' : '1',
'show_user_info' => $_POST['form']['show_user_info'] != '1' ? '0' : '1',
'show_post_count' => $_POST['form']['show_post_count'] != '1' ? '0' : '1',
'smilies' => $_POST['form']['smilies'] != '1' ? '0' : '1',
'smilies_sig' => $_POST['form']['smilies_sig'] != '1' ? '0' : '1',
'make_links' => $_POST['form']['make_links'] != '1' ? '0' : '1',
'topic_review' => intval($_POST['form']['topic_review']),
'topic_review' => (intval($_POST['form']['topic_review']) >= 0) ? intval($_POST['form']['topic_review']) : 0,
'disp_topics_default' => intval($_POST['form']['disp_topics_default']),
'disp_posts_default' => intval($_POST['form']['disp_posts_default']),
'indent_num_spaces' => intval($_POST['form']['indent_num_spaces']),
'quote_depth' => intval($_POST['form']['quote_depth']),
'indent_num_spaces' => (intval($_POST['form']['indent_num_spaces']) >= 0) ? intval($_POST['form']['indent_num_spaces']) : 0,
'quote_depth' => (intval($_POST['form']['quote_depth']) > 0) ? intval($_POST['form']['quote_depth']) : 1,
'quickpost' => $_POST['form']['quickpost'] != '1' ? '0' : '1',
'users_online' => $_POST['form']['users_online'] != '1' ? '0' : '1',
'censoring' => $_POST['form']['censoring'] != '1' ? '0' : '1',
Expand All @@ -65,9 +65,9 @@
'mailing_list' => pun_trim($_POST['form']['mailing_list']),
'avatars' => $_POST['form']['avatars'] != '1' ? '0' : '1',
'avatars_dir' => pun_trim($_POST['form']['avatars_dir']),
'avatars_width' => intval($_POST['form']['avatars_width']),
'avatars_height' => intval($_POST['form']['avatars_height']),
'avatars_size' => intval($_POST['form']['avatars_size']),
'avatars_width' => (intval($_POST['form']['avatars_width']) > 0) ? intval($_POST['form']['avatars_width']) : 1,
'avatars_height' => (intval($_POST['form']['avatars_height']) > 0) ? intval($_POST['form']['avatars_height']) : 1,
'avatars_size' => (intval($_POST['form']['avatars_size']) > 0) ? intval($_POST['form']['avatars_size']) : 1,
'admin_email' => strtolower(pun_trim($_POST['form']['admin_email'])),
'webmaster_email' => strtolower(pun_trim($_POST['form']['webmaster_email'])),
'forum_subscriptions' => $_POST['form']['forum_subscriptions'] != '1' ? '0' : '1',
Expand Down

0 comments on commit cf41ab6

Please sign in to comment.