Skip to content

fix(SaveAs): improve filename validation, fix cant-empty-field bug, prefill path where available#5689

Open
emberfiend wants to merge 1 commit into
mainfrom
fix/saveas-fullpath-and-validation
Open

fix(SaveAs): improve filename validation, fix cant-empty-field bug, prefill path where available#5689
emberfiend wants to merge 1 commit into
mainfrom
fix/saveas-fullpath-and-validation

Conversation

@emberfiend
Copy link
Copy Markdown
Collaborator

Summary

improve filename validation: some basic sanity checks on file names, pretty permissive so shouldn't annoy anyone
fix cant-empty-field bug: switched unedited flag to null so that emptying the field doesn't cause it to be regenerated
prefill path where available: allows anonymous-browser direct editing endpoint sessions to see the full file path

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

…refill path where available

Signed-off-by: Andrew Backhouse <andrew.backhouse@nextcloud.com>
@joshtrichards
Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member

@joshtrichards joshtrichards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cypress tests will need to be adjusted to accomodate / cover.

},
},
isValidName() {
const value = this.newFileName.trim()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also validate against https://github.com/nextcloud-libraries/nextcloud-files/blob/main/lib/utils/filename-validation.ts#L120 but fine to get this in as it fixes the original bug

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.

3 participants