mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
The pathToURI function was using url.PathEscape which incorrectly escapes forward slashes (/ -> %2F). This caused file URIs like: /home/angaz -> file://%2Fhome%2Fangaz (broken) File managers couldn't parse these malformed URIs correctly, causing them to open the wrong directory (often a parent directory). Fixed by using url.URL struct to properly construct file URIs: /home/angaz -> file:///home/angaz (correct) Spaces and other special characters are still properly escaped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e0cd24272c
commit
acae20950f
2 changed files with 9 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ After processing, the content will be moved to the main changelog and this file
|
|||
- Fix window menu crash on Wayland caused by appmenu-gtk-module accessing unrealized window (#4769) by @leaanthony
|
||||
- Fix GTK application crash when app name contains invalid characters (spaces, parentheses, etc.) by @leaanthony
|
||||
- Fix "not enough memory" error when initializing drag and drop on Windows (#4701) by @overlordtm
|
||||
- Fix file explorer opening wrong directory on Linux due to incorrect URI escaping (#4397) by @leaanthony
|
||||
- Fix AppImage build failure on modern Linux distributions (Arch, Fedora 39+, Ubuntu 24.04+) by auto-detecting `.relr.dyn` ELF sections and disabling stripping (#4642) by @leaanthony
|
||||
<!-- Bug fixes -->
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,14 @@ func pathToURI(path string) string {
|
|||
if err != nil {
|
||||
return path
|
||||
}
|
||||
return "file://" + url.PathEscape(absPath)
|
||||
// Use url.URL to properly construct file URIs.
|
||||
// url.PathEscape incorrectly escapes forward slashes (/ -> %2F),
|
||||
// which breaks file manager path parsing.
|
||||
u := &url.URL{
|
||||
Scheme: "file",
|
||||
Path: absPath,
|
||||
}
|
||||
return u.String()
|
||||
}
|
||||
|
||||
func findDesktopFile(xdgFileName string) (string, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue