Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

added in regex test for folder name

Ollie Halliday1faa3cc0963c
diff --git a/studio/localStores/storageExplorer/StorageExplorerStore.js b/studio/localStores/storageExplorer/StorageExplorerStore.js
index 6d75f5f36db..824e81462a4 100644
--- a/studio/localStores/storageExplorer/StorageExplorerStore.js
+++ b/studio/localStores/storageExplorer/StorageExplorerStore.js
@@ -317,6 +317,13 @@ class StorageExplorerStore {
const formattedName = this.sanitizeNameForDuplicateInColumn(folderName, autofix, columnIndex)
if (formattedName === null) return
+ if (!/^[a-zA-Z0-9_-]*$/.test(formattedName)) {
+ return this.ui.setNotification({
+ message: 'Folder name contains invalid special characters',
+ category: 'error',
+ duration: 8000,
+ })
+ }
/**
* todo: move this to a util file, as renameFolder() uses same logic
*/