[7.x] Updated ValidatesAttributes::validateUrl to use Symfony/Validator 5.1 regex#32302
Closed
bsacharski wants to merge 85 commits intolaravel:7.xfrom
bsacharski:validateurl-symfony-5-1
Closed
[7.x] Updated ValidatesAttributes::validateUrl to use Symfony/Validator 5.1 regex#32302bsacharski wants to merge 85 commits intolaravel:7.xfrom bsacharski:validateurl-symfony-5-1
bsacharski wants to merge 85 commits intolaravel:7.xfrom
bsacharski:validateurl-symfony-5-1
Conversation
[8.x] Use testbench-core 6
# Conflicts: # .travis.yml
This PR adds support for a new php artisan schema:dump command which uses mysqldump or pgdump to dump the current state of your schema to a database/schema/{connection}-schema.mysql file.
When this file exists and php artisan migrate or php artisan migrate:fresh is run AND no migrations have run against the database yet (migrations table is empty), this schema file will be loaded into the database first and then any outstanding migrations will be run. This means that effectively this schema file would typically only ever be used during local development or during CI testing. In production, you would typically already have migrations that have run in the past so this schema file would never be triggered.
Once the schema file is created, any or all of your existing migrations my be deleted as long as they have already run against your production environment. They are no longer needed during local development since the schema file exists. For convenience, a --prune flag has been added to the schema:dump command to delete your existing migrations after dumping the schema.
This new feature solves two problems. First, it relieves developers from having a huge migrations directory full of files they no longer need. Second, loading a single schema file is quicker than running hundreds of migrations for each test class in your applications, so your tests can run much faster when using a schema.
GrahamCampbell
requested changes
Apr 8, 2020
|
|
||
| /** | ||
| * @dataProvider validUrls | ||
| * @group WIP |
|
|
||
| /* | ||
| * This pattern is derived from Symfony\Component\Validator\Constraints\UrlValidator (2.7.4). | ||
| * This pattern is derived from Symfony Validator component, file Constraints/UrlValidator.php (5.1.0). |
Collaborator
There was a problem hiding this comment.
Please leave this as the class name.
Collaborator
There was a problem hiding this comment.
There is no 5.1.0 version, also?
GrahamCampbell
requested changes
Apr 8, 2020
|
|
||
| /* | ||
| * This pattern is derived from Symfony\Component\Validator\Constraints\UrlValidator (2.7.4). | ||
| * This pattern is derived from Symfony Validator component, file Constraints/UrlValidator.php (5.1.0). |
Collaborator
There was a problem hiding this comment.
There is no 5.1.0 version, also?
* Add isEmpty() method to HtmlString * Update HtmlString.php * Update HtmlString.php Co-authored-by: Taylor Otwell <taylor@laravel.com>
….7 regex The regex used by url validation logic was previously derived from version 2.7.4 of Symfony Validator component. As it turns out, old regex had a bug where it wouldn't accept urls where domain was a hostname ending with a digit. As such, the urls like http://domain1/ would be considered as invalid. To fix this issue I've updated \Illuminate\Validation\Concerns\ValidatesAttributes::validateUrl method using regex derived from version 5.0.7 of the Symfony Validator component. To make sure that the fix works, new test cases were also added.
Contributor
Author
|
@GrahamCampbell thanks for review. I guess this is why I shouldn't code before going to bed and few minutes after waking up (rebased the master onto 7.x-derived branch...) 😄 Created new PR (with properly used & referenced STABLE Symfony version) #32307 |
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.
The regex used by url validation logic was previously derived from version
2.7.4 of Symfony Validator component. As it turns out, old regex had a bug
where it wouldn't accept urls where domain was a hostname ending with a digit.
As such, the urls like http://domain1/ would be considered as invalid.
To fix this issue I've updated \Illuminate\Validation\Concerns\ValidatesAttributes::validateUrl
method using regex derived from version 5.1.0 of the Symfony Validator component.
To make sure that the fix works, new test cases were also added.