-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Bug: Token Regex for fileuniqueid* matches too broadly #751
Comments
Ramping this up to bug as I got a case where some content was matched by the RegEx and pnpframework/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs Lines 323 to 325 in ab5fa53
But the invalid pnpframework/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs Line 340 in ab5fa53
Proposed fix: |
I noticed that there is a RegEx responsible for capturing tokens in the UpdateListItem process. However, if the list item contains a JSON, the existing RegEx does not validate correctly. There could probably be a rewrite of the regex here or in the next process of the condition to exclude tokens that start with a quotation mark or single quote, because it identifies a JSON property. However, I've made an improvement to the RegEx:
Matching - all tokens that containst at list :
I'm not specifying fileuniqueid or fileuniqueidencoded because it's implicit in the RegEx. Can someone please validate if there is a match that is not being adressed? If this is the right solution, I can do a PR of my code |
This Regex matches more than just
fileuniqueid*
tokens:pnpframework/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs
Line 283 in 83eaf1f
This will be handled OK since exceptions are swallowed, but calls are made that are not necessary (for every field content containing curly braces). So this Regex could be improved to not trigger those redundant calls.
Alternative easy improvement: after this line:
pnpframework/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ListItemUtilities.cs
Line 308 in 83eaf1f
Add:
This catches most mismatches and prevents further redundant calls.
The text was updated successfully, but these errors were encountered: