Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizetizer Regex Fix #19600

Merged
merged 3 commits into from Jan 22, 2024
Merged

Conversation

Eden-Mor
Copy link
Contributor

@Eden-Mor Eden-Mor commented Dec 27, 2023

#19574
Fixed Resizetizer Regex not allowing single letter characters. "a"
I also fixed another part of the regex where a the following input was allowed when it shouldnt have. "a="

The regex is based off the error given by regex. Requirements are:

  1. First char should be a lowercase letter between a-z
  2. The rest can be a lowercase letter or a number 0-9 or an underscore.
  3. Lastly, the last character is NOT an underscore.

Description of Change

Changed the regex from
^[a-z]+[a-z0-9_]{0,}[^_]$
to
^[a-z]([a-z0-9_]*[a-z0-9])?$

Issues Fixed

Fixes #19574

dotnet#19574 
Fixed Resizetizer Regex not allowing single letter characters.
"a"
I also fixed another part of the regex where a the following input was allowed when it shouldnt have.
"a="

The regex is based off the error given by regex. Requirements are:
1. First char should be a lowercase letter between a-z
2. The rest can be a lowercase letter or a number 0-9 or an underscore.
3. Lastly, the last character is NOT an underscore.
@Eden-Mor Eden-Mor requested a review from a team as a code owner December 27, 2023 15:27
@ghost ghost added the community ✨ Community Contribution label Dec 27, 2023
@ghost
Copy link

ghost commented Dec 27, 2023

Hey there @Xenooooon! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@Eilon Eilon added the area/single project ☝️ Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Dec 29, 2023
@jfversluis
Copy link
Member

@mattleibow any particular reason this was done?

@jfversluis
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mattleibow
Copy link
Member

@mattleibow any particular reason this was done?

This was done because I understand all the simple and non-dodgy concepts about regex. 🤣

@Xenooooon thanks for the change! Is it possible to add some of your test cases to src\SingleProject\Resizetizer\test\UnitTests\FilenameTests.cs?

@Eden-Mor
Copy link
Contributor Author

@dotnet-policy-service agree

@Eden-Mor
Copy link
Contributor Author

@mattleibow Done!

@mattleibow
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mattleibow mattleibow enabled auto-merge (squash) January 21, 2024 19:53
@mattleibow mattleibow merged commit 5503a6a into dotnet:main Jan 22, 2024
47 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/single project ☝️ Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resizetizer doesn't allow having one-letter named images
4 participants