Skip to content

fix(totp): otpauth link in QR code URL#784

Merged
kasparsd merged 1 commit intoWordPress:masterfrom
sjinks:fix-otpauth-url
Feb 9, 2026
Merged

fix(totp): otpauth link in QR code URL#784
kasparsd merged 1 commit intoWordPress:masterfrom
sjinks:fix-otpauth-url

Conversation

@sjinks
Copy link
Contributor

@sjinks sjinks commented Feb 9, 2026

What?

The TOTP URL inside the #two-factor-qr-code paragraph in the User Profile is not rendered because esc_url() returns an empty string if it encounters an unknown/not allowed protocol.

Fixes: #783

Why?

esc_url() returns an empty string if it encounters an unknown/not allowed protocol. otpauth: is not among the allowed ones.

How?

Pass array( 'otpauth' ) to esc_url().

Testing Instructions

  1. Log in.
  2. Got to /wp-admin/profile.php
  3. Check the link around the QR code under the "Please scan the QR code or manually copy the shared secret key from below to your Authenticator app:" label.

Screenshots or screencast

Screenshot_20260209_192446

Changelog Entry

Fixed - OTP Authentication URL is rendered correctly.

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sjinks <volodymyrkolesnykov@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Collaborator

@kasparsd kasparsd left a comment

Choose a reason for hiding this comment

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

Thank you! Not sure how this got missed. I see that other instances have the protocol added correctly.

@kasparsd kasparsd merged commit 9feb978 into WordPress:master Feb 9, 2026
29 checks passed
@sjinks
Copy link
Contributor Author

sjinks commented Feb 9, 2026

I was training my agent (it reviews plugins and scans them for security issues and bugs - I am doing this for WPVIP), and it found this issue 🙂

@kasparsd
Copy link
Collaborator

kasparsd commented Feb 9, 2026

@sjinks Nice!

Does that mean that WPVIP is now running the latest revision of the plugin?

@sjinks
Copy link
Contributor Author

sjinks commented Feb 9, 2026

Automattic/vip-go-mu-plugins#6742

0.14.2 runs in staging environments. Tomorrow it will be in production.

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.

TOTP URL Around QR Code is not Rendered

3 participants