diff --git a/modules/node.module b/modules/node.module index 012211b83b7b413a61d70b97f502ac5cb32804ad..f6a55086211f9a85a4d2f3e0bb83fba48660946d 100644 --- a/modules/node.module +++ b/modules/node.module @@ -61,7 +61,6 @@ function node_search($keys) { function node_conf_options() { $output .= form_select(t("Default number of nodes to display"), "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t("The default maximum number of nodes to display on the main page.")); - $output .= form_select(t("Minimum number of words in teaser"), "minimum_teaser_size", variable_get("minimum_teaser_size", 0), array(0 => "0 words", 10 => "10 words", 25 => "25 words", 50 => "50 words", 75 => "75 words", 100 => "100 words", 125 => "125 words", 150 => "150 words", 175 => "175 words", 200 => "200 words"), t("The minimum number of words a teaser should consist of. This can be useful to rule out submissions that do not meet the site's standards, such as short test post.")); return $output; } @@ -519,14 +518,6 @@ function node_validate($node, &$error) { $error["date"] = "<div style=\"color: red;\">". t("You have to specifiy a valid date.") ."</div>"; } - /* - ** Validate the "teaser"-field: - */ - - if ($node->teaser && count(explode(" ", $node->teaser)) < variable_get("minimum_teaser_size", 0)) { - $error["teaser"] = "<div style=\"color: red;\">". t("Your teaser is too short.") ."</div>"; - } - } return $node; @@ -652,7 +643,7 @@ function node_add($type) { global $user; /* - ** If a node type has been specified, validate it existence. If no + ** If a node type has been specified, validate it existence. If no ** (valid) node type has been provied, display a node type overview. */ @@ -732,7 +723,11 @@ function node_preview($edit) { */ foreach ($edit as $key => $value) { - $node->$key = check_input($value); + $node->$key = check_output($value); + /* + ** NOTE: we can't do a check_query() or check_input() here as they + ** add slashes which results in breakage. + */ } /* diff --git a/modules/node/node.module b/modules/node/node.module index 012211b83b7b413a61d70b97f502ac5cb32804ad..f6a55086211f9a85a4d2f3e0bb83fba48660946d 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -61,7 +61,6 @@ function node_search($keys) { function node_conf_options() { $output .= form_select(t("Default number of nodes to display"), "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t("The default maximum number of nodes to display on the main page.")); - $output .= form_select(t("Minimum number of words in teaser"), "minimum_teaser_size", variable_get("minimum_teaser_size", 0), array(0 => "0 words", 10 => "10 words", 25 => "25 words", 50 => "50 words", 75 => "75 words", 100 => "100 words", 125 => "125 words", 150 => "150 words", 175 => "175 words", 200 => "200 words"), t("The minimum number of words a teaser should consist of. This can be useful to rule out submissions that do not meet the site's standards, such as short test post.")); return $output; } @@ -519,14 +518,6 @@ function node_validate($node, &$error) { $error["date"] = "<div style=\"color: red;\">". t("You have to specifiy a valid date.") ."</div>"; } - /* - ** Validate the "teaser"-field: - */ - - if ($node->teaser && count(explode(" ", $node->teaser)) < variable_get("minimum_teaser_size", 0)) { - $error["teaser"] = "<div style=\"color: red;\">". t("Your teaser is too short.") ."</div>"; - } - } return $node; @@ -652,7 +643,7 @@ function node_add($type) { global $user; /* - ** If a node type has been specified, validate it existence. If no + ** If a node type has been specified, validate it existence. If no ** (valid) node type has been provied, display a node type overview. */ @@ -732,7 +723,11 @@ function node_preview($edit) { */ foreach ($edit as $key => $value) { - $node->$key = check_input($value); + $node->$key = check_output($value); + /* + ** NOTE: we can't do a check_query() or check_input() here as they + ** add slashes which results in breakage. + */ } /*