diff --git a/actions/comicpress_update-cpm-config.php b/actions/comicpress_update-cpm-config.php index 14952ce..25a94c7 100644 --- a/actions/comicpress_update-cpm-config.php +++ b/actions/comicpress_update-cpm-config.php @@ -17,10 +17,10 @@ function cpm_action_update_cpm_config() { $validate_function_name = "cpm_validate_cpm_option_" . str_replace("-", "_", $option_info['id']); $ok = true; if (function_exists($validate_function_name)) { - $ok = call_user_func($validate_function_name, $_POST[$option_info['id']]); + $ok = call_user_func($validate_function_name, stripslashes($_POST[$option_info['id']])); } - if ($ok) { - $target_update_options[$target_key] = $_POST[$option_info['id']]; + if ($ok) { + $target_update_options[$target_key] = stripslashes($_POST[$option_info['id']]); } else { $target_update_options[$target_key] = $option_info['default']; update_option($target_key, $option_info['default']); diff --git a/comicpress_manager_library.php b/comicpress_manager_library.php index 7acbdad..dfe8539 100644 --- a/comicpress_manager_library.php +++ b/comicpress_manager_library.php @@ -240,8 +240,9 @@ function generate_post_hash($filename_date, $filename_converted_title) { $override_title = $_POST['override-title-to-use']; $tags = $_POST['tags']; if (get_magic_quotes_gpc()) { - $override_title = stripslashes($override_title); - $tags = stripslashes($tags); + foreach (array('override_title', 'tags', 'post_content') as $field) { + ${$field} = stripslashes(${$field}); + } } $post_title = !empty($override_title) ? $override_title : $filename_converted_title;