Commit 53eaba45 authored by Dries's avatar Dries

- Patch #87065 by Eaton et al: correct filtering of PHP nodes.

parent fbc47b43
......@@ -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;
}
......
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