Commit 5aba929c authored by Steven Wittens's avatar Steven Wittens

#49926: Allow break tag usage with PHP format, don't cut off otherwise.

parent bda8b0fd
......@@ -153,21 +153,21 @@ function node_teaser($body, $format = NULL) {
return $body;
}
// If a valid delimiter has been specified, use it to chop off the teaser.
if ($delimiter !== FALSE) {
return substr($body, 0, $delimiter);
}
// We check for the presence of the PHP evaluator filter in the current
// format. If the body contains PHP code, we do not split it up to prevent
// parse errors.
if (isset($format)) {
$filters = filter_list_format($format);
if (isset($filters['filter/1']) && (strpos($body, '<?') !== FALSE) && ($delimiter === FALSE || strpos($body, '<?') < $delimiter)) {
if (isset($filters['filter/1']) && strpos($body, '<?') !== FALSE) {
return $body;
}
}
// If a valid delimiter has been specified, use it to chop of the teaser.
if ($delimiter !== FALSE) {
return substr($body, 0, $delimiter);
}
// If we have a short body, the entire body is the teaser.
if (strlen($body) < $size) {
return $body;
......
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