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

Encoding issues with user and body names #4793

Closed
RichardTaylor opened this issue Aug 12, 2018 · 7 comments · May be fixed by #7186
Closed

Encoding issues with user and body names #4793

RichardTaylor opened this issue Aug 12, 2018 · 7 comments · May be fixed by #7186
Assignees
Labels
bug Breaks expected functionality f:admin stale Issues with no activity for 12 months x:uk

Comments

@RichardTaylor
Copy link

Users with names containing an apostrophe have their names displayed with an encoding error in a number of circumstances including the listing on /admin/users and in the draft messages used when an admin hides a request.

There are user facing issues too, and encoded strings are ending up in correspondence, as noted at:

https://github.com/mysociety/alaveteli-professional/issues/549

(I thought this issue should be tracked publicly as well as where it impacts Pro users)

screen shot 2018-08-12 at 20 28 43

@RichardTaylor RichardTaylor added the bug Breaks expected functionality label Aug 12, 2018
@garethrees
Copy link
Member

@RichardTaylor
Copy link
Author

Reopening following a user report of an issue occurring when being prompted to sign in to send a follow-up message to the Information Commissioner's Office.

See screenshot:

Screenshot 2022-07-20 at 18 18 32

@RichardTaylor RichardTaylor reopened this Jul 20, 2022
@mdeuk mdeuk self-assigned this Jul 23, 2022
@mdeuk
Copy link
Collaborator

mdeuk commented Jul 23, 2022

Reopening following a user report of an issue occurring when being prompted to sign in to send a follow-up message to the Information Commissioner's Office.

See screenshot:

Screenshot 2022-07-20 at 18 18 32

This issue appears to be occurring because the authority_name in the web parameter passed from followups_controller.rb to ask_to_login (application_controller.rb) are not html safe. A fix, modelled off #4807, should be fairly easy.

Example:
PostRedirect Create (2.1ms) INSERT INTO "post_redirects" ("token", "uri", "post_params_yaml", "created_at", "updated_at", "email_token", "reason_params_yaml") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["token", "lir1ci3sf16tgyn9dz0"], ["uri", "/request/118/followups/new/32"], ["post_params_yaml", "--- !ruby/object:ActionController::Parameters\nparameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n controller: followups\n action: new\n request_id: '118'\n incoming_message_id: '32'\npermitted: false\n"], ["created_at", "2022-07-23 16:25:21.391941"], ["updated_at", "2022-07-23 16:25:21.391941"], ["email_token", "e3ein3t7nw9ciluqz2y"], ["reason_params_yaml", "---\n:web: To send a follow up message to Information Commissioner's Office\n:email: Then you can write follow up message to Information Commissioner's Office.\n:email_subject: Write your FOI follow up message to Information Commissioner's\n Office\n:user_name: Joe Admin\n:user_url: [redacted]/user/joe_admin\n"]]

@mdeuk
Copy link
Collaborator

mdeuk commented Jul 23, 2022

Fix: change info_request.public_body.name to info_request.public_body.name.html_safe in followups_controller.rb.

Rectified output:

PostRedirect Create (0.7ms) INSERT INTO "post_redirects" ("token", "uri", "post_params_yaml", "created_at", "updated_at", "email_token", "reason_params_yaml") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["token", "cydi3si43p66xmft587"], ["uri", "/request/118/followups/new/32"], ["post_params_yaml", "--- !ruby/object:ActionController::Parameters\nparameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n controller: followups\n action: new\n request_id: '118'\n incoming_message_id: '32'\npermitted: false\n"], ["created_at", "2022-07-23 17:45:07.169448"], ["updated_at", "2022-07-23 17:45:07.169448"], ["email_token", "fz53xxu39vsfxtgw8p5"], ["reason_params_yaml", "---\n:web: To send a follow up message to Information Commissioner's Office\n:email: Then you can write follow up message to Information Commissioner's Office.\n:email_subject: Write your FOI follow up message to Information Commissioner's Office\n:user_name: Joe Admin\n:user_url: [redacted]/user/joe_admin\n"]]

Screenshot from WhatDoTheyKnow. The message displayed is 'To send a follow up message to Information Commissioner's Office, please sign in as Joe Admin'

@mdeuk
Copy link
Collaborator

mdeuk commented Jul 23, 2022

PR for followups_controller.rb raised in #7186

@RichardTaylor
Copy link
Author

Issue noted today with the confirmation email for a user-user message.

Encoded apostrophises were present in the user's name in the subject and body of the message.

Message in question:

Please click on the link below to confirm your email address. Then you can send a message to....

@HelenWDTK HelenWDTK added the stale Issues with no activity for 12 months label Nov 19, 2024
@HelenWDTK
Copy link
Contributor

This issue has been automatically closed due to a lack of discussion or resolution for over 12 months.
Should we decide to revisit this issue in the future, it can be reopened.

@HelenWDTK HelenWDTK closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks expected functionality f:admin stale Issues with no activity for 12 months x:uk
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants