projects
/
banana.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
really fix escaping
[banana.git]
/
banana
/
misc.inc.php
diff --git
a/banana/misc.inc.php
b/banana/misc.inc.php
index
936414c
..
3258ef1
100644
(file)
--- a/
banana/misc.inc.php
+++ b/
banana/misc.inc.php
@@
-37,7
+37,9
@@
function headerDecode($value) {
function headerEncode($value, $trim = 0) {
if ($trim) {
function headerEncode($value, $trim = 0) {
if ($trim) {
- $value = substr($value, $trim) . "[...]";
+ if (strlen($value) > $trim) {
+ $value = substr($value, 0, $trim) . "[...]";
+ }
}
return "=?UTF-8?B?".base64_encode($value)."?=";
}
}
return "=?UTF-8?B?".base64_encode($value)."?=";
}