summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@android.com> 2018-10-03 10:33:46 -0600
committer Jeff Sharkey <jsharkey@android.com> 2018-10-03 10:33:48 -0600
commit4a7b6ac0c4feaba13e63435955f37a90ec5672a6 (patch)
tree6e6445dc646395c764b7724cb057e81b75bae0fa
parentcca4ee0895b8681d29984cf3cdbedf4c30aeb038 (diff)
Log when Uris are normalized to help triage.
Bug: 112555574 Test: manual Change-Id: Iebf7785e93995f1a2a6d688a2b2aa0ec16c790c6
-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;
}