diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -1710,19 +1710,26 @@ $patch_html_lines = array(); foreach (phutil_split_lines($patch) as $line) { $len = strlen($line); + $color = null; if ($len >= 1 && $line[0] == '+') { - $patch_html_lines[] = "${line}"; + $color = 'green'; } else if ($len >= 1 && $line[0] == '-') { - $patch_html_lines[] = "${line}"; + $color = 'red'; } else if ($len >= 2 && substr($line, 0, 2) == '@@') { - $patch_html_lines[] = "${line}"; - } else { - $patch_html_lines[] = "${line}"; + $color = 'purple'; } + + $attrib = array(); + + if ($color) { + $attrib['style'] = "color:{$color};"; + } + + $patch_html_lines[] = phutil_tag('span', $attrib, $line); } - $html_patch = "
". - implode('
', $patch_html_lines).'
'; + $html_patch = "
".
+      implode('', $patch_html_lines).'
'; return array($patch, $html_patch); } diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -536,7 +536,7 @@ } } - $body = $params['body']; + $body = idx($params, 'body', ''); $max = PhabricatorEnv::getEnvConfig('metamta.email-body-limit'); if (strlen($body) > $max) { $body = phutil_utf8_shorten($body, $max);