Skip to content
Snippets Groups Projects
Commit 53eaba45 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

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

parent fbc47b43
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -665,8 +665,22 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) { ...@@ -665,8 +665,22 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {
* Apply filters and build the node's standard elements. * Apply filters and build the node's standard elements.
*/ */
function node_prepare($node, $teaser = FALSE) { 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( $node->content['body'] = array(
'#value' => check_markup($teaser ? $node->teaser : $node->body, $node->format, FALSE), '#value' => $teaser ? $node->teaser : $node->body,
'#weight' => 0, '#weight' => 0,
); );
...@@ -677,10 +691,6 @@ function node_prepare($node, $teaser = FALSE) { ...@@ -677,10 +691,6 @@ function node_prepare($node, $teaser = FALSE) {
); );
} }
if (strlen($node->teaser) < strlen($node->body)) {
$node->readmore = TRUE;
}
return $node; return $node;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment