Commit a9ef1826 authored by Dries's avatar Dries

- Patch 4916: improved preparation of $node->teaser and $node->body.  Patch by
  Goba.
parent b63747fd
......@@ -220,9 +220,7 @@ function blog_page() {
}
function blog_content($node) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
return $node;
return node_prepare($node);
}
function blog_view($node, $main = 0, $page = 0) {
......
......@@ -220,9 +220,7 @@ function blog_page() {
}
function blog_content($node) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
return $node;
return node_prepare($node);
}
function blog_view($node, $main = 0, $page = 0) {
......
......@@ -376,8 +376,7 @@ function book_content($node) {
ob_end_clean();
}
else {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
$node = node_prepare($node);
}
return $node;
......
......@@ -376,8 +376,7 @@ function book_content($node) {
ob_end_clean();
}
else {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
$node = node_prepare($node);
}
return $node;
......
......@@ -141,9 +141,7 @@ function forum_link($type, $node = 0, $main = 0) {
}
function forum_content($node) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
return $node;
return node_prepare($node);
}
function forum_view($node, $main = 0, $page = 0) {
......
......@@ -141,9 +141,7 @@ function forum_link($type, $node = 0, $main = 0) {
}
function forum_content($node) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
return $node;
return node_prepare($node);
}
function forum_view($node, $main = 0, $page = 0) {
......
......@@ -411,17 +411,20 @@ function node_view($node, $main = 0, $page = 0) {
** Default behavior:
*/
if ($node->teaser == $node->body) {
// Only invoke check_output() once for performance's sake:
$node->teaser = $node->body = check_output($node->teaser);
}
else {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
}
return theme("node", node_prepare($node), $main, $page);
}
}
return theme("node", $node, $main, $page);
function node_prepare($node) {
if ($node->teaser == $node->body) {
// Only invoke check_output() once for performance's sake:
$node->teaser = $node->body = check_output($node->teaser);
}
else {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
}
return $node;
}
function node_show($node, $cid) {
......
......@@ -411,17 +411,20 @@ function node_view($node, $main = 0, $page = 0) {
** Default behavior:
*/
if ($node->teaser == $node->body) {
// Only invoke check_output() once for performance's sake:
$node->teaser = $node->body = check_output($node->teaser);
}
else {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
}
return theme("node", node_prepare($node), $main, $page);
}
}
return theme("node", $node, $main, $page);
function node_prepare($node) {
if ($node->teaser == $node->body) {
// Only invoke check_output() once for performance's sake:
$node->teaser = $node->body = check_output($node->teaser);
}
else {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
}
return $node;
}
function node_show($node, $cid) {
......
......@@ -104,8 +104,7 @@ function page_content($node) {
if ($node->format == 0) {
// HTML type
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
$node = node_prepare($node);
}
else {
// PHP type
......
......@@ -104,8 +104,7 @@ function page_content($node) {
if ($node->format == 0) {
// HTML type
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
$node = node_prepare($node);
}
else {
// PHP type
......
......@@ -91,8 +91,6 @@ function story_form(&$node, &$help, &$error) {
}
function story_content($node) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
return $node;
return node_prepare($node);
}
?>
......@@ -91,8 +91,6 @@ function story_form(&$node, &$help, &$error) {
}
function story_content($node) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
return $node;
return node_prepare($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