Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
97cd9671
Commit
97cd9671
authored
Dec 22, 2022
by
p13dz
Committed by
Richard Pospesel
Feb 1, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40283: Workaround for the file upload bug
(cherry picked from commit
c23f2f39
)
parent
7ec236d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+9
-2
9 additions, 2 deletions
...iew/src/main/java/org/mozilla/geckoview/GeckoSession.java
with
9 additions
and
2 deletions
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+
9
−
2
View file @
97cd9671
...
...
@@ -4726,12 +4726,19 @@ public class GeckoSession {
return
super
.
confirm
();
}
private
static
String
normalizePath
(
String
input
)
{
// For an unclear reason, Android media picker delivers file paths
// starting with double slash. Firefox performs path validation on
// all paths, and double slash is deemed invalid.
return
input
.
startsWith
(
"//"
)
?
input
.
substring
(
1
)
:
input
;
}
private
static
String
getFile
(
final
@NonNull
Context
context
,
final
@NonNull
Uri
uri
)
{
if
(
uri
==
null
)
{
return
null
;
}
if
(
"file"
.
equals
(
uri
.
getScheme
()))
{
return
uri
.
getPath
();
return
normalizePath
(
uri
.
getPath
()
)
;
}
final
ContentResolver
cr
=
context
.
getContentResolver
();
final
Cursor
cur
=
...
...
@@ -4753,7 +4760,7 @@ public class GeckoSession {
try
{
final
String
path
=
cur
.
getString
(
idx
);
if
(
path
!=
null
&&
!
path
.
isEmpty
())
{
return
path
;
return
normalizePath
(
path
)
;
}
}
catch
(
final
Exception
e
)
{
}
...
...
This diff is collapsed.
Click to expand it.
morgan
@morgan
mentioned in issue
#40283 (closed)
·
Feb 1, 2023
mentioned in issue
#40283 (closed)
mentioned in issue #40283
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment