From 07ae0fad65ee536fe778c97180bf2e0ec151a865 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 4 Aug 2004 21:19:12 +0000 Subject: - Patch #9497 by gordon: made work even when the teaser length is set to unlimited and fixed up some code comments. --- modules/node.module | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules/node.module') diff --git a/modules/node.module b/modules/node.module index aa2f4963f..b7ec70493 100644 --- a/modules/node.module +++ b/modules/node.module @@ -160,14 +160,15 @@ function node_teaser($body) { $size = variable_get('teaser_length', 600); - // If the size is zero, teasers are disabled so we return the entire body. - if ($size == 0) { + // find where the delimiter is in the body + $delimiter = strpos($body, ''); + + // If the size is zero, and there is no delimiter, we return the entire body. + if ($size == 0 && $delimiter == 0) { return $body; } // If a valid delimiter has been specified, use it to chop of the teaser. - // The delimiter can be outside the allowed range by no more than a factor of two. - $delimiter = strpos($body, ''); if ($delimiter > 0) { return substr($body, 0, $delimiter); } -- cgit v1.2.3