#51495 closed defect (bug) (fixed)
The code in mod_rewrite_rules() to write to .htaccess is wrong.
Reported by: | nendeb55 | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | critical | Version: | 5.6 |
Component: | Rewrite Rules | Keywords: | has-patch |
Focuses: | rest-api | Cc: |
Description (last modified by )
Code in the rewrite_rules function
<?php $rules .= 'RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]';
1.There are no newlines, so the next line comes after it.
1.The .* -
in is not ^(.*) -
in RewriteRule.
Change History (10)
#1
@
4 years ago
- Focuses rest-api added
- Keywords needs-testing added
- Milestone changed from Awaiting Review to 5.6
#3
@
4 years ago
Thanks for the report! I'll get a pr/patch together this afternoon/evening. Kid wrangling solo atm. :)
This ticket was mentioned in PR #584 on WordPress/wordpress-develop by georgestephanis.
4 years ago
#4
- Keywords has-patch added; needs-patch removed
I didn't add the suggested parentheses, as I don't believe they are necessary to do the regex capture, and the prior working art for this seemed to run perfectly without them -- https://github.com/WordPress/application-passwords/wiki/Basic-Authorization-Header----Missing
Trac ticket: https://core.trac.wordpress.org/ticket/51495
This ticket was mentioned in Slack in #core-passwords by georgestephanis. View the logs.
4 years ago
#6
@
4 years ago
updated the pr after a minor oops in the first pass, should be a-ok now. :)
I skipped the parentheses as noted in the PR as we're not using them for capture so they shouldn't be needed here.
#8
@
4 years ago
- Summary changed from The code in mod_rewrite_rules() to write to .htaccsess is wrong. to The code in mod_rewrite_rules() to write to .htaccess is wrong.
#9
@
4 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 49131:
TimothyBJacobs commented on PR #584:
4 years ago
#10
Merged in 405a561.
Thanks for the report.
This change was introduced in [42790]. @georgestephanis @timothyblynjacobs can you take a look?