cvs: php-bugs-web /include functions.inc
| From: | Gabor Hojtsy | Date: | Mon, 04 Feb 2002 07:59:57 +0000 |
| Subject: | cvs: php-bugs-web /include functions.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-8521@lists.php.net to get a copy of this message | ||
goba Mon Feb 4 02:59:57 2002 EDT
Modified files:
/php-bugs-web/include functions.inc
Log:
Wrap headers intelligently. Looks readebale, if a header line is
more than 72 chars long, and we need to break it.
Index: php-bugs-web/include/functions.inc
diff -u php-bugs-web/include/functions.inc:1.17 php-bugs-web/include/functions.inc:1.18
--- php-bugs-web/include/functions.inc:1.17 Sun Feb 3 16:53:42 2002
+++ php-bugs-web/include/functions.inc Mon Feb 4 02:59:57 2002
@@ -194,8 +194,14 @@
$maxlength = (($maxlength < $actlength) ? $actlength : $maxlength);
}
+ # align header content with headers (if a header contains
+ # more than one line, wrap it intelligently)
+ $header_text = "";
+ $spaces = str_repeat(" ", $maxlength + 1);
foreach ($headers as $v) {
- $text[] = str_pad($v[0] . ":", $maxlength) . " " . $v[1];
+ $hcontent = wordwrap($v[1], 72-$maxlength, "\n$spaces"); # wrap and indent
+ $hcontent = rtrim($hcontent); # wordwrap may add spacer to last line
+ $header_text .= str_pad($v[0] . ":", $maxlength) . " " . $hcontent .
"\n";
}
if ($ncomment)
@@ -205,9 +211,9 @@
$user_text = "ATTENTION! Do NOT reply to this email!\n";
$user_text .= "To reply, use the web interface found at http://bugs.php.net/?id=$bug[id]&edit=2\n\n\n";
- $user_text .= join("\n",$text);
+ $user_text .= $header_text . join("\n",$text);
- $dev_text = join("\n",$text)
+ $dev_text = $header_text . join("\n",$text)
. "\n-- \nEdit this bug report at http://bugs.php.net/?id=$bug[id]&edit=1\n";
/* format mail so it looks nice */