I'm using V1.3.7.1 and notice a bug in the zen_truncate_paragraph() function. This can be found in includes\functions\functions_general.php
The symptom of this bug is that meta tag descriptions are not shorten. For example;
MAX_META_TAG_DESCRIPTION_LENGTH=120 and the string to be shorten equals 250 characters. This function will return the total string (250 characters) and not the shorten string. The reason being is that the function compares the number of words to the numbers of characters which creates this bug. Near line 1329 and 1330, you find this;
$sv_total is the number of words and $size is the maximum number of characters. One is comparing apples with oranges, so to say.PHP Code:if ($zv_total > $size) {
for ($x=0; $x < $size; $x++) {
Fix
Replace this function with the following code;
PHP Code:function zen_truncate_paragraph($paragraph, $size = 100) {
$zv_paragraph = trim($paragraph);
// if it's less than the size given, then return it
if (strlen($zv_paragraph) <= $size) return $zv_paragraph;
// backtrack to find the end of the last complete word
$len = $size;
while ($zv_paragraph[$len] != ' ' && $len) --$len;
return ($len)? substr($zv_paragraph, 0, $len) : substr($zv_paragraph, 0, $size);
}


, did not notice the description for MAX_META_TAG_DESCRIPTION_LENGTH. Thanks for that DrByte. I kind of assumed from the define label that the word DESCRIPTION_LENGTH would normally be the number of characters. A better define might be MAX_META_TAG_NUMBER_WORDS, but as a programmer I know how it goes.
