$date = cx_form_input_sanitized_date_time('post_date');
if (isset($date) == false) $date = null;
$draft = cx_form_input_sanitized('post_is_draft') == 'draft';
- $data = cx_form_input_sanitized('post_data');
+ $data = cx_form_input_sanitized_allowing_html('post_data');
if (isset($_GET['id']) == false or $_GET['id'] == 0) {
cx_posts_add_post(1, $title, $slug, $date, $draft, $data);
<?php
function cx_form_input_sanitized($name) {
+ $input = cx_form_input_sanitized_allowing_html($name);
+
+ if ($input != null) {
+ $input = strip_tags($input);
+ }
+
+ return $input;
+}
+
+function cx_form_input_sanitized_allowing_html($name) {
if (array_key_exists($name, $_POST)) {
$insecure_input = $_POST[$name];
- $tagless_input = strip_tags($insecure_input);
- return $tagless_input;
+ return $insecure_input;
} else {
return null;
}