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

[make:entity] Prevent entity name from having an accent #1474

Merged
merged 1 commit into from Mar 12, 2024

Conversation

Fan2Shrek
Copy link
Contributor

@Fan2Shrek Fan2Shrek commented Mar 5, 2024

Fixes #1379

Entity name cannot longer have accent :)

@jrushlow jrushlow changed the title Preven entity name to have an accent [make:entity] Prevent entity name from having an accent Mar 12, 2024
@jrushlow jrushlow added Feature New Feature Status: Reviewed Has been reviewed by a maintainer labels Mar 12, 2024
Copy link
Collaborator

@jrushlow jrushlow left a comment

Choose a reason for hiding this comment

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

Thank you @Fan2Shrek

@jrushlow jrushlow merged commit f8d45a6 into symfony:main Mar 12, 2024
6 checks passed
@jrushlow jrushlow mentioned this pull request Mar 22, 2024
@vsyrovat
Copy link

Bad MR. I had to downgrade to 1.56 because of it.

Firstly, the error message is inaccurate. The ASCII character set contains more than just A-Z range, see ascii-code dot com for details. So correct message for current regexp should be "Only a-zA-Z allowed" not "ASCII". (Actually, the result error message should not be this, I describe this point later).

Secondly, why only A-Z? Where is the digits? I want to make the OAuth2ClientProfile but with maker bundle 1.57 I cannot do this anymore. The maker bundle is broken now.

Thirdly, in the description of the issue exists phrase: "It would probably be wise to filter input and refuse problematic characters in class/entity names." Not "refuse all characters except of good" but "refuse problematic". In meaning, this is closer to a blacklist than a whitelist. Creating of a whitelist requires found ALL of the non-problematic characters before adding em to the whitelist. It means more attention and accuracy than blacklist.

Fourthly, this MR changes behavior of maker bundle significantly. Denying a programmer to use some character is bold, unreasonably bold. It is better to notify the programmer about problematic characters presented in typed entity name and let him decide whether to leave them. "The entity name you entered has some non-ASCII characters which are potentially problematic with SQLite. It is recommended to use only ASCII characters in entity names. Would you keep entered name? [no]".

So, I consider 1.57.0 is broken and see two possible solutions:

  • fast: add digits and underscore to the regexp,
  • full: use recommendations instead of prohibitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent entity with accentuated names in make:entity
4 participants