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
Add comment in Customer registration form, add better error message #14138
Add comment in Customer registration form, add better error message #14138
Conversation
@@ -27,7 +27,7 @@ | |||
{block name='form_errors'} | |||
<ul> | |||
{foreach $errors as $error} | |||
<li class="alert alert-danger">{$error}</li> | |||
<li class="alert alert-danger">{$error|strip_tags|nl2br nofilter}</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why strip_tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be sure no html tag is inserted (since I use nofilter
) only the converted \n
remain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove it, it will still work but I was worried of XSS injection 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only if someone include xss in translations, but we should be worried if it happens ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright I'll remove it then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
84fac05
to
5000116
Compare
@@ -170,7 +170,7 @@ | |||
> | |||
{if isset($field.availableValues.comment)} | |||
<span class="form-control-comment"> | |||
{$field.availableValues.comment} | |||
{$field.availableValues.comment|nl2br nofilter} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PierreRambaud I also removed this strip_tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the concat but not other way from now 😭
Me neither, but if I return an array the error blocks are separated.. This would require to change too many templates and error management.. |
'Shop.Forms.Errors' | ||
) . PHP_EOL . | ||
$this->translator->trans( | ||
'The following characters are not accepted: / \ ^ * `', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should tend towards shorter wordings, otherwise error notifications will be too present and discouraging. What about Invalid characters: /^*` instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me, @Samuel-Pires wdyt?
'Shop.Forms.Errors' | ||
) . PHP_EOL . | ||
$this->translator->trans( | ||
'The characters . and 。 are allowed only if they are directly followed by a space or the end of the string.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder about the "。" character... it seems pretty specific, is it an absolute necessity to mention it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this character is indeed forbidden, but maybe you're right If someone tries to use this character it is probably in order to use the breach so maybe it's not useful to indicate it for usual users
@jolelievre some returns, seen with @Samuel-Pires and @TristanLDD
|
@marionf, about the wording, you can also write A space is required after "." and "。" to give a sense of obligation. |
2844873
to
3c81050
Compare
@marionf @LouiseBonnard @Samuel-Pires @TristanLDD |
'Shop.Forms.Errors' | ||
) . PHP_EOL . | ||
$this->translator->trans( | ||
'A space is required after . and 。', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be written with quotation marks? Example: A space is required after "." and "。"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what is the best practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tristan was for the ""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you mean using 'A space is required after "." and "。"'
(Isn't the space after 。 weird in this case?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: the space can't be removed, it's part of the character
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, then @PierreRambaud can you re-approve this PR please? ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe some email browsers simplify them and convert them into regular
.
thus creating a clickable url
I confirm, try visiting https://www.apple。com 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But... this PR has been merged without the fix on the wording?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, then @PierreRambaud can you re-approve this PR please? ^^
@LouiseBonnard we've been tricked !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups my bad, I was too quick and thought I had already added it
Here's a PR to fix this ^^
#14163
John R.Hamond
a more detailed error message is displayedThis change is