From 53eaba45ccc4e5891666febb8df2407ec0175fba Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 4 Oct 2006 06:54:24 +0000 Subject: - Patch #87065 by Eaton et al: correct filtering of PHP nodes. --- modules/node/node.module | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index 2d008daba..83a6ed06f 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -665,8 +665,22 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) { * Apply filters and build the node's standard elements. */ function node_prepare($node, $teaser = FALSE) { + // First we'll overwrite the existing node teaser and body with + // the filtered copies! Then, we'll stick those into the content + // array and set the read more flag if appropriate. + if (strlen($node->teaser) < strlen($node->body)) { + $node->readmore = TRUE; + } + + if ($teaser == FALSE) { + $node->body = check_markup($node->body, $node->format, FALSE); + } + else { + $node->teaser = check_markup($node->teaser, $node->format, FALSE); + } + $node->content['body'] = array( - '#value' => check_markup($teaser ? $node->teaser : $node->body, $node->format, FALSE), + '#value' => $teaser ? $node->teaser : $node->body, '#weight' => 0, ); @@ -677,10 +691,6 @@ function node_prepare($node, $teaser = FALSE) { ); } - if (strlen($node->teaser) < strlen($node->body)) { - $node->readmore = TRUE; - } - return $node; } -- cgit v1.2.3