+ if (strlen($header) <= $hard_wrap) {
+
+ // if the header has been folded at least once before now,
+ // let's see if we can add the remaining chunk to the last
+ // fold (this is mainly just aesthetic)
+ //
+ if ($pull_last_line_up_if_second_to_last_is_already_over_soft_limit
+ && strlen($folded_header)
+ // last fold is conveniently in $new_fold
+ && strlen($new_fold) + strlen($header) <= $hard_wrap) {
+ // $last_fold = substr(substr($folded_header, 0, -(strlen($CRLF) + strlen($indent))),
+ // remove CRLF and indentation and paste the rest of the header on
+ $folded_header = substr($folded_header, 0, -(strlen($CRLF) + strlen($indent))) . $header;
+ $header = '';
+ }
+