Skip to content

session_create_id - error message for large prefix #15338

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

Merged
merged 6 commits into from
Aug 15, 2024

Conversation

jorgsowa
Copy link
Contributor

Adds exclusive error message for prefixes larger than 256 characters. Currently, it shows the wrong message Prefix cannot contain special characters. Only the A-Z, a-z, 0-9....

Comment on lines 2389 to 2393
/* E_ERROR raised for security reason. */
php_error_docref(NULL, E_WARNING, "Prefix cannot contain special characters. Only the A-Z, a-z, 0-9, \"-\", and \",\" characters are allowed");
RETURN_FALSE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, the comment is leading me to believe that this should be an exception

@jorgsowa jorgsowa force-pushed the session_prefix_id_larger_than_256 branch from 5c9e5aa to 0a2b1a2 Compare August 14, 2024 20:04
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I do wonder if maybe we shouldn't create some ValueError utility functions, as a lot of them have standard messages ("cannot be empty", "must be greater than or equal to %d", etc.)

@Girgias Girgias merged commit 21fa5e1 into php:master Aug 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants