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

No data validation on get_segment_description #81

Open
TitusBraber opened this issue Jun 6, 2024 · 0 comments
Open

No data validation on get_segment_description #81

TitusBraber opened this issue Jun 6, 2024 · 0 comments

Comments

@TitusBraber
Copy link

I was testing some inputs in a try except block to see if the user enters a proper cronstring, during which I found something weird:

So far so good:

Your input, * * 23 * * , lead to the following repeat string: Every minute, on day 23 of the month

When you enter something like * * * facerolloverkeyboard *, or * * * * facerolloverkeyboard it will throw a FormatException as expected.

However, when you enter * * facerolloverkeyboard * *, it doesn't throw an error, instead it says:

Your input, * * facerolloverkeyboard * *, lead to the following repeat string: Every minute, on day facerolloverkeyboard of the month

I believe the path is
through: https://github.com/Salamek/cron-descriptor/blob/master/cron_descriptor/ExpressionDescriptor.py#L386
into: https://github.com/Salamek/cron-descriptor/blob/master/cron_descriptor/ExpressionDescriptor.py#L455

Similarly, when you enter facerolloverkeyboard * * * *, it doesn't throw an error, instead it says:

Your input, facerolloverkeyboard * * * *, lead to the following repeat string: At facerolloverkeyboard minutes past the hour

I believe the path is
through: https://github.com/Salamek/cron-descriptor/blob/master/cron_descriptor/ExpressionDescriptor.py#L255
into: https://github.com/Salamek/cron-descriptor/blob/master/cron_descriptor/ExpressionDescriptor.py#L455

I am not quite sure where the correct FormatException get thrown, and why it's not thrown for minutes and DoM. If you have any clue I can take it up from there and test and make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant