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

Improve support for special characters in blognames #7

Merged
merged 2 commits into from
Jan 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion providers/class.two-factor-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function generate_and_email_token( $user ) {
$token = $this->generate_token( $user->ID );

/* translators: %s: site name */
$subject = wp_strip_all_tags( sprintf( __( 'Your login confirmation code for %s', 'two-factor' ), get_bloginfo( 'name' ) ) );
$subject = wp_strip_all_tags( sprintf( __( 'Your login confirmation code for %s', 'two-factor' ), mb_encode_mimeheader( get_option( 'blogname' ), ENT_QUOTES ) ) );

Choose a reason for hiding this comment

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

What about html_entity_decode()? Looks fine if it works as expected though.

Copy link
Author

Choose a reason for hiding this comment

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

I'd defer to @ajvillegas on whether that was tried or not. wp_specialchars_decode which the upstream uses definitely does not fix it, so I would guess that the more specific function here is likely necessary.

/* translators: %s: token */
$message = wp_strip_all_tags( sprintf( __( 'Enter %s to log in.', 'two-factor' ), $token ) );

Expand Down