From 18d19626b0b4311107cb9ceda726d52e115c04a9 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 28 Aug 2009 08:43:00 -0400 Subject: [PATCH] cpm option setting fixes --- actions/comicpress_update-cpm-config.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/actions/comicpress_update-cpm-config.php b/actions/comicpress_update-cpm-config.php index 9f918dd..14952ce 100644 --- a/actions/comicpress_update-cpm-config.php +++ b/actions/comicpress_update-cpm-config.php @@ -22,6 +22,8 @@ function cpm_action_update_cpm_config() { if ($ok) { $target_update_options[$target_key] = $_POST[$option_info['id']]; } else { + $target_update_options[$target_key] = $option_info['default']; + update_option($target_key, $option_info['default']); $all_valid = false; break 2; } @@ -52,7 +54,8 @@ function cpm_action_update_cpm_config() { } function cpm_validate_cpm_option_cpm_default_post_time($value) { - return (strtotime("2008-01-01 {$value}") !== false); + $result = strtotime("2008-01-01 {$value}"); + return ($result !== false) && ($result !== -1); } ?> \ No newline at end of file