$previousFold ) { $search--; } if ( $search == $previousFold ) { // continuous string of more than limit chars. // We will just have to continue searching forwards to the next whitespace instead // This is not confirming to standard.. but what can we do? $search += self::$limit; // back to where we started while ( $text[$search] != " " && $text[$search] != "\t" && $search < $length ) { $search++; } } // lets fold if ( $folded === "" ) { $folded = substr( $text, $previousFold, $search - $previousFold ); } else { $folded .= ezcMailTools::lineBreak() . substr( $text, $previousFold, $search - $previousFold ); } $previousFold = $search; } // we need to append the rest if there is any if ( $search < $length ) { $folded .= ezcMailTools::lineBreak() . substr( $text, $search ); } return $folded; } } ?>