Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] dialog.open and convertFileSrc breaks if file name or path contains [ #5234

Closed
MessyComposer opened this issue Sep 19, 2022 · 0 comments
Labels
scope: core Core packages of Tauri status: backlog Issue is ready and we can work on it status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@MessyComposer
Copy link

Describe the bug

Using dialog.open, if the file or file path opened contains [ (eg. ./pictures/img[test.jpeg , or ./pictures/te[st/img.jpeg)
it will result in the following error:
invalid glob pattern: Pattern syntax error near position 30: invalid range pattern

If the file path closes the [ (eg. ./pictures/img[test].jpeg or even ./pictures/te[st/img].jpeg)
it opens the file as expected, but breaks when trying to display said file, resulting in the following error:
asset protocol not configured to allow the path: C:\...\img[test].jpeg

Other files open and display as expected.

Reproduction

  1. Prepare test files matching the above examples
  2. Create a project
  3. Add file dialog, convert path with convertFileSrc, and set to img src
  4. Try opening and displaying the files

Expected behavior

The files will be opened and displayed just like the others

Platform and versions

Environment
› OS: Windows 10.0.19044 X64
› Webview2: 105.0.1343.42
› MSVC:
- Visual Studio Community 2019
› Node.js: 16.15.1
› npm: 8.11.0
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.63.0
› cargo: 1.63.0
› Rust toolchain: stable-x86_64-pc-windows-msvc

Packages
› @tauri-apps/cli [NPM]: 1.1.1
› @tauri-apps/api [NPM]: 1.1.0
› tauri [RUST]: 1.0.5,
› tauri-build [RUST]: 1.0.4,
› tao [RUST]: 0.12.2,
› wry [RUST]: 0.19.0,

App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
› framework: Vue.js

App directory structure
├─ .vscode
├─ node_modules
├─ public
├─ src
└─ src-tauri

Stack trace

No response

Additional context

No response

@MessyComposer MessyComposer added status: needs triage This issue needs to triage, applied to new issues type: bug labels Sep 19, 2022
@amrbashir amrbashir added scope: core Core packages of Tauri status: backlog Issue is ready and we can work on it status: needs triage This issue needs to triage, applied to new issues and removed status: needs triage This issue needs to triage, applied to new issues labels Sep 19, 2022
lucasfernog added a commit that referenced this issue Nov 8, 2022
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
lucasfernog added a commit that referenced this issue Nov 8, 2022
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
lucasfernog added a commit that referenced this issue Nov 8, 2022
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core Core packages of Tauri status: backlog Issue is ready and we can work on it status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants