名前[姓]/名前[名]に半角・全角スペースが登録できてしまう件の修正 #4453
Open
otsuka-star wants to merge 3 commits into
Open
Conversation
Collaborator
|
@otsuka-star ユニットテストの調整をお願いします。わからなかったら、連絡ください。 |
Collaborator
|
@otsuka-star はい、合ってます |
Contributor
teratai3
reviewed
Jul 21, 2026
| ->notEmptyString('real_name_1', __d('baser_core', '名前[姓]を入力してください。')); | ||
| ->notEmptyString('real_name_1', __d('baser_core', '名前[姓]を入力してください。')) | ||
| ->add('real_name_1', [ | ||
| 'noWhitespace' => [ |
Contributor
There was a problem hiding this comment.
カスタムでバリデーションルールを実装するより、regexで対応できるのではと考えていますがどうでしょうか?
コアでもregexが多用されている印象があり、複雑なロジックの場合だけカスタムでバリデーションルールが実装されている気がします。
3.8系みたいですが以下がまとまっています。
https://qiita.com/azukiazusa/items/9e8bbe461bdbc7ee572c
| 'rule' => function ($value) { | ||
| return !preg_match('/[ ]/u', $value); | ||
| }, | ||
| 'message' => __d('baser_core', '名前[姓]に半角・全角スペースは使用できません。') |
Contributor
There was a problem hiding this comment.
名前[姓]に半角・全角スペースは使用できません。
上記はすでに多言語化、対応ファイルが追記されているのかと考えましたが、まだのようなので、以下ファイルに多言語化対応などを追記する必要がありそうです。
例:
- plugins/baser-core/resources/locales/baser_core.pot
- plugins/baser-core/resources/locales/en/baser_core.po
なお別prで対応いただく形であれば問題ないと思います。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


@ryuring
以下の改修を行いましたので、レビューお願いします。
改修内容: