Repository navigation
Conversation
LIVR 2.5 amends the url rule (koorchik/LIVR#98): only a port, a path, a query or a fragment may follow the host, a label of the host has 1-63 characters, and a port has 1-5 digits and a value of 0-65535. FILTER_VALIDATE_URL already rejected labels longer than 63 characters and ports above 65535, and accepted one-digit ports. It accepted a dot after the host (https://www.google., https://example.com./path) and a port with other characters (:8a, :+80, an empty port), which the url rule now rejects. The rest of the rule is unchanged. The LIVR 2.5 test suite is copied from the LIVR repository again, with the new cases in test_suite_2.5/{positive,negative}/36-url.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR applies the LIVR 2.5
urlfix (koorchik/LIVR#98), which was added to the specification after #40:WRONG_URL(https://www.google.,https://example.com./path,http://192.0.2.1./);https://example.com:8a,:+80and an empty port now giveWRONG_URL(FILTER_VALIDATE_URLread them as numbers);FILTER_VALIDATE_URL, so nothing changes there.The rest of the rule is unchanged.
tests/test_suite_2.5is copied from the LIVR repository again (new cases in*/36-url), a unit test covers the port and host cases, and the README lists the change.The change was prepared with the help of an LLM and tested: PHPUnit and phpcs pass on PHP 7.2–8.5, the versions of the CI matrix. Thank you for reviewing it!