-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Be more lenient in reading maintenance.ip addresses #3634
Conversation
Currently, only commas are accepted to split IPs, and no spaces are allowed (only at the start/end of the file, not after the comma). This `preg_split()` allows splitting on spaces, commas, or new lines, such that these contents for `maintenance.ip` are valid: ``` 1.1.1.1, 1.1.1.2 1.1.1.3 1.1.1.4 1.1.1.5, 1.1.1.6 ``` Result: ```php array ( 0 => '1.1.1.1', 1 => '1.1.1.2', 2 => '1.1.1.3', 3 => '1.1.1.4', 4 => '1.1.1.5', 5 => '1.1.1.6', ) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great!
(Would love better IPv6 prefix support too)
Co-authored-by: Sven Reichel <github-sr@hotmail.com>
Made some changes. Didn't make much sense to |
Agreed. Rewritten. |
@m-overlund anything to add for IPv6? I have no aspiration towards it tbh |
@loekvangool I'm not able to contribute sorry. |
Co-authored-by: Ng Kiat Siong <kiatsiong.ng@gmail.com>
Can we keep the comment? |
the comment is still there but modified, how would you like that? |
Either its too late, or too early 😎 Missed that. Sry. |
Could be done in a follow up PR by introducing a lib like symfony ip utils. |
Currently, only commas are accepted to split IPs, and no spaces are allowed (only at the start/end of the file, not after the comma).
Event this input is currently invalid:
1.1.1.1, 1.1.1.2
because it will not trim the space.This
preg_split()
allows splitting on spaces, commas, or new lines, such that these contents formaintenance.ip
are valid:Result: