Commit e7e104e8 authored by Dries's avatar Dries

- node system:

   + Made the filters work again!

   + There is one strange thing that I can't track down though: for some
     reason, "^M" characters (?) are padded after newline ("\n" and / or
     "\r") characters.
parent 0222ee66
......@@ -170,7 +170,9 @@ function node_save($node, $filter) {
foreach ($node as $key => $value) {
if (in_array($key, $fields)) {
$k[] = check_query($key);
$v[] = "'". check_query($value) ."'";
$v[] = "'". check_input($value) ."'";
// NOTE: for the values we use 'check_input()' such that we apply
// the filters
}
}
......@@ -192,7 +194,9 @@ function node_save($node, $filter) {
// prepare the query:
foreach ($node as $key => $value) {
if (in_array($key, $fields)) {
$q[] = check_query($key) ." = '". check_query($value) ."'";
$q[] = check_query($key) ." = '". check_input($value) ."'";
// NOTE: for the values we use 'check_input()' such that we apply
// the filters
}
}
......
......@@ -90,7 +90,7 @@ function node_filter_link($text) {
function node_filter($text) {
if (variable_get("filter_html", 0)) $text = node_filter_html($text);
if (variable_get("filter_link", 0)) $text = node_filter_link($text);
return $text;
return trim($text);
}
function node_link($type, $node = 0) {
......@@ -671,11 +671,19 @@ function node_preview($edit) {
$edit["created"] = time();
}
/*
** Apply the required filters:
*/
foreach ($edit as $key => $value) {
$node->$key = check_input($value);
}
/*
** Display a preview of the node:
*/
node_view($edit);
node_view($node);
return node_form($edit);
}
......
......@@ -90,7 +90,7 @@ function node_filter_link($text) {
function node_filter($text) {
if (variable_get("filter_html", 0)) $text = node_filter_html($text);
if (variable_get("filter_link", 0)) $text = node_filter_link($text);
return $text;
return trim($text);
}
function node_link($type, $node = 0) {
......@@ -671,11 +671,19 @@ function node_preview($edit) {
$edit["created"] = time();
}
/*
** Apply the required filters:
*/
foreach ($edit as $key => $value) {
$node->$key = check_input($value);
}
/*
** Display a preview of the node:
*/
node_view($edit);
node_view($node);
return node_form($edit);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment