#49926: Allow break tag usage with PHP format, don't cut off otherwise.
parent
bda8b0fdb5
commit
5aba929c04
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue