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

fix: sanitize NNBF characters in uploaded files #26022

Merged
merged 1 commit into from May 22, 2024

Conversation

charislam
Copy link
Contributor

MacOS 14.0+ uses a narrow no-break space (U+202F) in the timestamp of automatically named screenshots (12-hour clock only). This is not a valid filename character for storage, and screenshots are probably a common-ish use case, so treat this as a special case and replace with a normal space.

See:

To test:

  • On a Mac, make sure your system is set to 12-hour clock.
  • Take a screenshot and save it with its default name.
  • Try uploading it to storage via the UI.

@charislam charislam requested a review from a team as a code owner May 10, 2024 21:08
Copy link

vercel bot commented May 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
design-system ❌ Failed (Inspect) May 22, 2024 4:08pm
studio-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 4:08pm
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
database-new ⬜️ Ignored (Inspect) May 22, 2024 4:08pm
docs ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 4:08pm
studio ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 4:08pm
studio-self-hosted ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 4:08pm
zone-www-dot-com ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 4:08pm

Copy link

supabase bot commented May 10, 2024

No changes detected in supabase directory.
This pull request has been ignored for the connected project xguihxuzqibwxjnimxev due to its connection settings.
Go to Project Integrations Settings ↗︎ in order to change this behavior.


Branching Preview Branches by Supabase.
Learn more about Supabase for Git ↗︎.

@charislam charislam force-pushed the fix/storage-upload-mac-screenshots branch from 0397567 to 5036f2e Compare May 22, 2024 15:50
Storage maintains a list of allowed characters, which excludes some
characters used automatically by OSes for naming files (e.g., Mac
default screenshot naming). To preempt errors, replace any characters
that aren't alphanumerics, underscores, hyphens, or periods with
underscores.

See: https://forum.obsidian.md/t/unable-to-attach-screenshot-images-in-macos-14-0-when-wikilinks-turned-off-urlencode-u-202f-char/68410/6
@charislam charislam force-pushed the fix/storage-upload-mac-screenshots branch from 5036f2e to 08119f0 Compare May 22, 2024 15:51
@charislam charislam merged commit 69c1988 into master May 22, 2024
14 of 15 checks passed
@charislam charislam deleted the fix/storage-upload-mac-screenshots branch May 22, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants