Compare commits

...

2 Commits

@ -3600,7 +3600,7 @@ public class MessageHelper {
MimeTextPart p1 = parts.get(p);
MimeTextPart p2 = parts.get(p + 1);
// https://bugzilla.mozilla.org/show_bug.cgi?id=1374149
if (!"ISO-2022-JP".equalsIgnoreCase(p1.charset) &&
if (!("ISO-2022-JP".equalsIgnoreCase(p1.charset) && "B".equalsIgnoreCase(p1.encoding)) &&
p1.charset != null && p1.charset.equalsIgnoreCase(p2.charset) &&
p1.encoding != null && p1.encoding.equalsIgnoreCase(p2.encoding) &&
p1.text != null && !p1.text.endsWith("=")) {

@ -419,31 +419,44 @@ public class UriHelper {
path = path.toLowerCase(Locale.ROOT);
boolean first = "www.facebook.com".equals(host);
for (String key : url.getQueryParameterNames()) {
// https://en.wikipedia.org/wiki/UTM_parameters
// https://docs.oracle.com/en/cloud/saas/marketing/eloqua-user/Help/EloquaAsynchronousTrackingScripts/EloquaTrackingParameters.htm
String lkey = key.toLowerCase(Locale.ROOT);
if (PARANOID_QUERY.contains(lkey) ||
lkey.startsWith("utm_") ||
lkey.startsWith("elq") ||
((host != null && host.endsWith("facebook.com")) &&
!first &&
FACEBOOK_WHITELIST_PATH.contains(path) &&
!FACEBOOK_WHITELIST_QUERY.contains(lkey)) ||
("store.steampowered.com".equals(host) &&
"snr".equals(lkey)))
changed = true;
else if (!TextUtils.isEmpty(key))
for (String value : url.getQueryParameters(key)) {
Log.i("Query " + key + "=" + value);
Uri suri = Uri.parse(value);
String q = url.getEncodedQuery();
if (q != null) {
StringBuilder sb = new StringBuilder();
for (String kv : q.split("&")) {
int eq = kv.indexOf('=');
String key = (eq < 0 ? kv : kv.substring(0, eq));
String value = (eq < 0 ? null : kv.substring(eq + 1));
// https://en.wikipedia.org/wiki/UTM_parameters
// https://docs.oracle.com/en/cloud/saas/marketing/eloqua-user/Help/EloquaAsynchronousTrackingScripts/EloquaTrackingParameters.htm
String lkey = key.toLowerCase(Locale.ROOT);
if (PARANOID_QUERY.contains(lkey) ||
lkey.startsWith("utm_") ||
lkey.startsWith("elq") ||
((host != null && host.endsWith("facebook.com")) &&
!first &&
FACEBOOK_WHITELIST_PATH.contains(path) &&
!FACEBOOK_WHITELIST_QUERY.contains(lkey)) ||
("store.steampowered.com".equals(host) &&
"snr".equals(lkey)))
changed = true;
else if (!TextUtils.isEmpty(key)) {
Uri suri = Uri.parse(key);
if (suri != null && isHyperLink(suri)) {
Uri s = sanitize(context, suri);
return (s == null ? suri : s);
}
builder.appendQueryParameter(key, value);
if (sb.length() > 0)
sb.append('&');
sb.append(key);
if (value != null) {
sb.append('=').append(value);
}
}
first = false;
first = false;
}
if (sb.length() > 0)
builder.encodedQuery(sb.toString());
}
return (changed ? builder.build() : null);

Loading…
Cancel
Save