- 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.
4.0.x
Dries Buytaert 2001-11-18 13:21:35 +00:00
parent 0222ee6666
commit e7e104e82f
3 changed files with 26 additions and 6 deletions

View File

@ -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
}
}

View File

@ -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);
}

View File

@ -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);
}