summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-08-04 21:19:12 +0000
committerDries Buytaert <dries@buytaert.net>2004-08-04 21:19:12 +0000
commit07ae0fad65ee536fe778c97180bf2e0ec151a865 (patch)
tree90a49e3c84c9266e812e7962f456cd9c71c05c3c /modules
parentb87b2abe6520715a6813a23127061be7331df6f1 (diff)
downloadbrdo-07ae0fad65ee536fe778c97180bf2e0ec151a865.tar.gz
brdo-07ae0fad65ee536fe778c97180bf2e0ec151a865.tar.bz2
- Patch #9497 by gordon: made <!--break--> work even when the teaser length
is set to unlimited and fixed up some code comments.
Diffstat (limited to 'modules')
-rw-r--r--modules/node.module9
-rw-r--r--modules/node/node.module9
2 files changed, 10 insertions, 8 deletions
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, '<!--break-->');
+
+ // 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, '<!--break-->');
if ($delimiter > 0) {
return substr($body, 0, $delimiter);
}
diff --git a/modules/node/node.module b/modules/node/node.module
index aa2f4963f..b7ec70493 100644
--- a/modules/node/node.module
+++ b/modules/node/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, '<!--break-->');
+
+ // 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, '<!--break-->');
if ($delimiter > 0) {
return substr($body, 0, $delimiter);
}