Skip to content

[Bug]: [stable28] "forbidden_chars" config not effective #49601

Open
@julien-nc

Description

⚠️ This issue respects the following points: ⚠️

Bug description

It is still possible to rename files with forbidden characters in the Files app.

I could track it down to an initial state value being provided in https://github.com/nextcloud/server/blob/stable28/apps/files/lib/Controller/ViewController.php#L277
and the name validation check being done in https://github.com/nextcloud/server/blob/stable28/apps/files/src/utils/filenameValidity.ts#L28-L29 with validateFilename from @nextcloud/files. Maybe the initial state value is not handled correctly...

Steps to reproduce

  1. Set 'forbidden_chars' => ['+', '%', '#', '?', '<', '>', ':', '*', '|', '"'], in config.php
  2. Rename a file with a name that contains one of the forbidden characters

Expected behavior

In NC 29.0.9, it is prevented and a hint is displayed:
Image

Nextcloud Server version

28

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions