Add support in BasicHtmlWebResponseObject for open-ended input tags#16193
Merged
daxian-dbw merged 1 commit intoPowerShell:masterfrom Nov 2, 2021
Merged
Conversation
iSazonov
reviewed
Oct 5, 2021
vexx32
reviewed
Oct 5, 2021
Collaborator
There was a problem hiding this comment.
Suggested change
| s_inputFieldRegex = new Regex(@"<input\s+[^>]*(/>|>|>.*?</input>)", | |
| s_inputFieldRegex = new Regex(@"<input\s+[^>]*(/?>|>.*?</input>)", |
I think this is a bit of an easier to read / simpler regex expression that should have the same result.
bca62e6 to
337e349
Compare
iSazonov
reviewed
Oct 7, 2021
- Supports open-ended (no end slash) input tags, to match void element spec. - Adds unit tests confirming other forms of input tags are unaffected. Update unit tests and simplify regular expression Leverage testcases
337e349 to
9e51abe
Compare
iSazonov
approved these changes
Oct 7, 2021
Contributor
Author
|
@iSazonov is there a next step for merging? I'm not an authorized member. From what I can tell, it should be okay to happen 1 business day after approval. |
Collaborator
|
@farmerau We are waiting MSFT members to review. Since it is Regex they can find compliance issues. /cc @daxian-dbw @TravisEz13 friendly ping. |
daxian-dbw
approved these changes
Oct 19, 2021
Collaborator
|
@farmerau Thanks for your contribution! |
|
🎉 Handy links: |
TrapGodBrim
pushed a commit
to TrapGodBrim/PowerShell
that referenced
this pull request
Jan 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Per #16126,
BasicHtmlWebResponseObjectdidn't fully support valid html forinputfields. Specifically, for anInvoke-WebRequestthat returns this valid html:would have a null
InputFieldsvalue.To solve this, I've added an alternative construct to the regular expression (as recommended by the author of the issue) that requires neither a closing slash '/' nor a closing input tag ''.
Additionally, I've created Pester test cases to validate the outcome of the updated expression.
PR Context
(For reference #15973)
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).