Opened 4 months ago
Last modified 2 months ago
#65417 assigned defect (bug)
Bug: Classic Editor link dialog prepends http:// to URLs with uppercase protocol
| Reported by: | nimeshatxecurify | Owned by: | nimeshatxecurify |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: | javascript |
Description (last modified by )
Steps to Reproduce
- Go to
http://localhost:8889/wp-admin - Create or edit a post/page
- Switch to the Classic Editor (Visual tab)
- Select some text (e.g. "click here") OR place the cursor in the editor
- Click the Insert/Edit Link button (chain icon in the toolbar)
- In the URL field, type:
HTTPS://example.com(uppercase protocol — common on mobile keyboards with auto-capitalization) - Click outside the URL field / press Tab (triggers the blur event →
correctURLruns)
Expected: URL remains HTTPS://example.com (or is normalized to https://example.com)
Actual: URL becomes http://HTTPS://example.com — a completely broken double-protocol URL
Attachments (5)
Change History (26)
This ticket was mentioned in PR #12103 on WordPress/wordpress-develop by @nimeshatxecurify.
4 months ago
#1
- Keywords has-patch has-unit-tests added
This ticket was mentioned in Slack in #core by nimeshatxecurify. View the logs.
4 months ago
This ticket was mentioned in Slack in #core by abdullahramzan. View the logs.
4 months ago
#7
@
4 months ago
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/12103
Environment
- WordPress: 7.1-alpha-20260605.071112
- Subdirectory: No
- PHP: 8.3.31
- Server: PHP.wasm
- Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
- Browser: Chrome 148.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.5
- MU Plugins: None activated
- Plugins:
- Classic Editor 1.7.0
- Test Reports 1.3.0
Steps taken
- ✅ Patch is solving the problem
Expected result
- After applying the patch, the issue with Classic Editor link dialog prepends http:// to URLs with uppercase protocol has been resolved.
Screenshots/Screencast with results
#8
@
4 months ago
Tested patch. Uppercase protocol issue is fixed.
Typed HTTPS://example.com in the URL field, and after blur/Tab it correctly remains as uppercase (or normalizes to lowercase) instead of prepending http://.
No double-protocol URLs. Works as expected.
#9
@
4 months ago
- Milestone Awaiting Review → 7.1
Confirmed in 6.9 as well. Moving to 7.1 for consideration.
#10
@
4 months ago
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/12103
Environment
- WordPress: 7.1-alpha-20260605.071112
- Subdirectory: No
- PHP: 8.3.31
- Database: WP_SQLite_Driver
- Browser: Chrome
- OS: Windows 11
- Theme: Twenty Twenty-Five
- MU Plugins: None activated
- Plugins:
- Classic Editor 1.7.0
- Test Reports 1.3.0
Steps taken
- Applied the patch from the PR.
- Tested the Classic Editor link dialog with URLs containing uppercase protocol values.
Result
- Patch successfully resolves the reported issue.
- URLs with uppercase protocols no longer get incorrectly modified by prepending
http://.
Expected result
The Classic Editor link dialog should preserve the original URL protocol format without adding an unwanted http:// prefix.
#11
@
3 months ago
I tested this issue in WordPress Playground with the Classic Editor plugin enabled. Following the reported reproduction steps, I entered an uppercase protocol (HTTPS://seorepairkit.com) in the link URL field and triggered the blur event by moving focus away from the input. The URL was handled correctly and was not modified to http://HTTPS://seorepairkit.com. I also verified that repeatedly opening and interacting with the link did not result in an additional http:// prefix being added. The protocol was preserved (or normalized to lowercase) without creating a duplicate protocol.
#13
@
3 months ago
Tested using the WordPress Playground instance linked from the GitHub PR.
Environment
- WordPress Playground (PR preview)
- Browser: Firefox
- OS: macOS
Tested
- HTTPS://bestwebsite.com
- HTTP://bestwebsite.com
- Https://bestwebsite.com
- https://bestwebsite.com
- http://bestwebsite.com
- ftp://example.com
- /about
- #section1
Confirmed uppercase and mixed-case URL schemes are preserved correctly and http:// is no longer prepended. Existing lowercase protocols, relative URLs, and fragment links also continue to behave as expected. I also verified the links after saving the post, reloading the editor, and editing the links again.
Patch tested successfully.
This ticket was mentioned in Slack in #core by adrianduffell. View the logs.
3 months ago
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
3 months ago
This ticket was mentioned in Slack in #core-test by noruzzaman. View the logs.
2 months ago
nazmulasif commented on PR #12103:
2 months ago
#18
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/12103
Environment
- WordPress: 7.1-beta4-20260730.062011
- Subdirectory: No
- PHP: 8.5.8 (cli)
- Server: PHP.wasm (Emscripten 4.0.19 wasm32)
- Database: WP_MySQL_On_SQLite (Server: 8.0.38 / Client: 3.51.0)
- Browser: Chrome 150.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.5
- MU Plugins: None activated
- Plugins:
- Classic Editor 1.7.0
- Test Reports 1.3.0
Steps taken
- Opened WordPress Playground PR preview for PR #12103 (Trac #65417) with the Classic Editor active.
- Navigated to Posts > Add New and created a Classic Editor instance.
- Added sample text, selected it, and clicked the Insert/Edit Link icon in the toolbar.
- Clicked the Link Options gear icon (⚙️) to open the full
wpLinkmodal dialog. - In the URL field, entered a URL with an uppercase protocol (
https://example.com/andhttp://example.com/). - Moved focus away from the input field (triggered
blurevent /wpLink.correctURL()) and submitted the link dialog. - Also verified directly in the browser developer console by targeting the modal input DOM element:
`javascript jQuery('#wp-link-url').val('https://example.com/'); wpLink.correctURL(); console.log(jQuery('#wp-link-url').val()); Result: "https://example.com/"
- Confirmed that the URL protocol is preserved as entered without prepending
http://.
- ✅ Patch is solving the problem
Expected result
URLs containing uppercase or mixed-case protocols (e.g. https://example.com/ or http://example.com/) should be recognized as already having a scheme and should NOT have http:// prepended to create broken double-protocol URLs (http://https/://example.com).
Additional Notes
Tested and verified pull request #12103 for Trac #65417.
Screenshots/Screencast with results
Attached: showing manual test verification in post editor
Support Content
Trac Ticket: https://core.trac.wordpress.org/ticket/65417
https://github.com/user-attachments/assets/66a8b918-c8cc-4436-9994-5be0a140dc73
This ticket was mentioned in Slack in #core by adrianduffell. View the logs.
2 months ago
#20
@
2 months ago
Test Report
Environment:
WordPress: 7.1 Beta 4
PHP: 8.3.x
OS: Windows 11
Browser: Google Chrome
Theme: Twenty Twenty-Five
Plugins: Classic editor
Result:
✅Patch tested and works as expected.
I successfully reproduced the reported issue before applying the proposed patch from PR #12103. After applying the patch, I repeated the same reproduction steps and confirmed that the URL is handled correctly when entering an uppercase protocol (HTTPS://). I did not observe any regressions while testing the Classic Editor link dialog.
Screenshots: Attached (before and after applying the patch).


![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)


Updates the regex used in the link dialog to support schemes with uppercase letters. This prevents the editor from prepending
http://to URLs likeHTTPS://orHttp://, which are commonly produced by mobile keyboards.Includes new QUnit tests to verify correct handling of uppercase, mixed-case, fragment, and root-relative URLs.
Trac ticket: https://core.trac.wordpress.org/ticket/65417
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Sonnet 4.6