Skip to content

Making messages of register.cshtml consistent with the User settings#8301

Merged
sebastienros merged 4 commits into
OrchardCMS:devfrom
LaserSrl:fix/8300_register_password_messages
Dec 19, 2019
Merged

Making messages of register.cshtml consistent with the User settings#8301
sebastienros merged 4 commits into
OrchardCMS:devfrom
LaserSrl:fix/8300_register_password_messages

Conversation

@HermesSbicego-Laser

Copy link
Copy Markdown
Contributor

Fixes #8300

var requirementsMessage = T.Plural("The password can't be empty", "Passwords are required to be a minimum of {0} characters in length", (int)ViewData["PasswordLength"]).Text;
var additionalRequirementsMessage = new List<string>();
if ((bool)ViewData["LowercaseRequirement"]) {
additionalRequirementsMessage.Add(T("one lowercase letter").Text);

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.

Can you ensure the Text property is not html encoded, otherwise it would result in double encoding in the output. To try it just replace some text with html, it should be encoded only once.

@HermesSbicego-Laser HermesSbicego-Laser Dec 13, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can confirm that T("").Text does not html encode the string.
image
image

@HermesSbicego-Laser HermesSbicego-Laser Dec 13, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looking better into the code I noticed we need to have similar changes somewhere else.
I will integrate this PR soon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done with 2 new commits

@sebastienros

Copy link
Copy Markdown
Member

LGTM as long as there is no double encoding

@HermesSbicego-Laser

Copy link
Copy Markdown
Contributor Author

It should be good to be merged in dev.

@sebastienros
sebastienros merged commit e47aca5 into OrchardCMS:dev Dec 19, 2019
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.

Make some messages of the shape register.cshtml consistent with the User settings

2 participants