summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@google.com> 2018-10-03 21:17:51 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-10-03 21:17:51 +0000
commit08a42ed82afb9293f983cf6d356c37391f7bc70c (patch)
treeb1c40e6831e4c953eccf6c9bb65d59b376d0c92b
parentc7be180ec45e1d5fb2049c67325e1a7feb7f19f1 (diff)
parent4a7b6ac0c4feaba13e63435955f37a90ec5672a6 (diff)
Merge "Log when Uris are normalized to help triage."
-rw-r--r--core/java/android/content/ContentProvider.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index a64eead04c6f..a13a438cd7f7 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -2104,7 +2104,11 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
// a source of security issues.
final String encodedPath = uri.getEncodedPath();
if (encodedPath != null && encodedPath.indexOf("//") != -1) {
- return uri.buildUpon().encodedPath(encodedPath.replaceAll("//+", "/")).build();
+ final Uri normalized = uri.buildUpon()
+ .encodedPath(encodedPath.replaceAll("//+", "/")).build();
+ Log.w(TAG, "Normalized " + uri + " to " + normalized
+ + " to avoid possible security issues");
+ return normalized;
} else {
return uri;
}