8000 Merge branch '4.4' into 5.3 · PhilETaylor/symfony@3174426 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3174426

Browse files
Merge branch '4.4' into 5.3
* 4.4: [Form] UrlType should not add protocol to emails Silence isatty warnings during tty detection Replaced full CoC text with link to documentation
2 parents e108a7f + fa6a03a commit 3174426

File tree

5 files changed

+30
-101
lines changed

5 files changed

+30
-101
lines changed

CODE_OF_CONDUCT.md

Lines changed: 6 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,8 @@
1-
Code of Conduct
2-
===============
1+
# Code of Conduct
32

4-
Our Pledge
5-
----------
3+
This project follows a [Code of Conduct][code_of_conduct] in order to ensure an open and welcoming environment.
4+
Please read the full text for understanding the accepted and unaccepted behavior.
5+
Please read also the [reporting guidelines][guidelines], in case you encountered or witnessed any misbehavior.
66

7-
In the interest of fostering an open and welcoming environment, we as
8-
contributors and maintainers pledge to making participation in our project and
9-
our community a harassment-free experience for everyone, regardless of age, body
10-
size, disability, ethnic origin, gender identity and expression, level of
11-
experience, education, socio-economic status, nationality, personal appearance,
12-
religion, or sexual identity and orientation.
13-
14-
Our Standards
15-
-------------
16-
17-
Examples of behavior that contributes to creating a positive environment
18-
include:
19-
20-
* Using welcoming and inclusive language
21-
* Being respectful of differing viewpoints and experiences
22-
* Gracefully accepting constructive criticism
23-
* Focusing on what is best for the community
24-
* Showing empathy towards other community members
25-
26-
Examples of unacceptable behavior by participants include:
27-
28-
* The use of sexualized language or imagery and unwelcome sexual attention or
29-
advances
30-
* Trolling, insulting/derogatory comments, and personal or political attacks
31-
* Public or private harassment
32-
* Publishing others' private information, such as a physical or electronic
33-
address, without explicit permission
34-
* Other conduct which could reasonably be considered inappropriate in a
35-
professional setting
36-
37-
Our Responsibilities
38-
--------------------
39-
40-
[CoC Active Response Ensurers, or CARE][1], are responsible for clarifying the
41-
standards of acceptable behavior and are expected to take appropriate and fair
42-
corrective action in response to any instances of unacceptable behavior.
43-
44-
CARE team members have the right and responsibility to remove, edit, or reject
45-
comments, commits, code, wiki edits, issues, and other contributions that are
46-
not aligned to this Code of Conduct, or to ban temporarily or permanently any
47-
contributor for other behaviors that they deem inappropriate, threatening,
48-
offensive, or harmful.
49-
50-
Scope
51-
-----
52-
53-
This Code of Conduct applies both within project spaces and in public spaces
54-
when an individual is representing the project or its community. Examples of
55-
representing a project or community include using an official project e-mail
56-
address, posting via an official social media account, or acting as an appointed
57-
representative at an online or offline event. Representation of a project may be
58-
further defined and clarified by CARE team members.
59-
60-
Enforcement
61-
-----------
62-
63-
Instances of abusive, harassing, or otherwise unacceptable behavior
64-
[may be reported][2] by contacting the [CARE team members][1].
65-
All complaints will be reviewed and investigated and will result in a response
66-
that is deemed necessary and appropriate to the circumstances. The CARE team is
67-
obligated to maintain confidentiality with regard to the reporter of an
68-
incident. Further details of specific enforcement policies may be posted
69-
separately.
70-
71-
CARE team members who do not follow or enforce the Code of Conduct in good
72-
faith may face temporary or permanent repercussions as determined by the
73-
[core team][3].
74-
75-
Attribution
76-
-----------
77-
78-
This Code of Conduct is adapted from the [Contributor Covenant version 1.4][4].
79-
80-
[1]: https://symfony.com/doc/current/contributing/code_of_conduct/care_team.html
81-
[2]: https://symfony.com/doc/current/contributing/code_of_conduct/reporting_guidelines.html
82-
[3]: https://symfony.com/doc/current/contributing/code/core_team.html
83-
[4]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
7+
[code_of_conduct]: https://symfony.com/coc
8+
[guidelines]: https://symfony.com/doc/current/contributing/code_of_conduct/reporting_guidelines.html

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,11 @@ private static function hasColorSupport()
408408
}
409409

410410
if (\function_exists('stream_isatty')) {
411-
return stream_isatty(\STDOUT);
411+
return @stream_isatty(\STDOUT);
412412
}
413413

414414
if (\function_exists('posix_isatty')) {
415-
return posix_isatty(\STDOUT);
415+
return @posix_isatty(\STDOUT);
416416
}
417417

418418
$stat = fstat(\STDOUT);

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ private function isInteractiveInput($inputStream): bool
489489
}
490490

491491
if (\function_exists('stream_isatty')) {
492-
return self::$stdinIsInteractive = stream_isatty(fopen('php://stdin', 'r'));
492+
return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
493493
}
494494

495495
if (\function_exists('posix_isatty')) {
496-
return self::$stdinIsInteractive = posix_isatty(fopen('php://stdin', 'r'));
496+
return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r'));
497497
}
498498

499499
if (!\function_exists('exec')) {

src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php

< F438 span aria-hidden="true" class="f6 text-bold fgColor-danger">-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function onSubmit(FormEvent $event)
3636
{
3737
$data = $event->getData();
3838

39-
if ($this->defaultProtocol && $data && \is_string($data) && !preg_match('~^[\w+.-]+://~', $data)) {
39+
if ($this->defaultProtocol && $data && \is_string($data) && !preg_match('~^([\w+.-]+://|[^:/?@#]++@)~', $data)) {
4040
$event->setData($this->defaultProtocol.'://'.$data);
4141
}
4242
}

src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,49 @@
2020

2121
class FixUrlProtocolListenerTest extends TestCase
2222
{
23-
public function testFixHttpUrl()
23+
public function provideUrlToFix()
2424
{
25-
$data = 'www.symfony.com';
26-
$form = new Form(new FormConfigBuilder('name', null, new EventDispatcher()));
27-
$event = new FormEvent($form, $data);
28-
29-
$filter = new FixUrlProtocolListener('http');
30-
$filter->onSubmit($event);
31-
32-
$this->assertEquals('http://www.symfony.com', $event->getData());
25+
return [
26+
['www.symfony.com'],
27+
['twitter.com/@symfony'],
28+
['symfony.com?foo@bar'],
29+
['symfony.com#foo@bar'],
30+
['localhost'],
31+
];
3332
}
3433

35-
public function testSkipKnownUrl()
34+
/**
35+
* @dataProvider provideUrlToFix
36+
*/
37+
public function testFixUrl($data)
3638
{
37-
$data = 'http://www.symfony.com';
3839
$form = new Form(new FormConfigBuilder('name', null, new EventDispatcher()));
3940
$event = new FormEvent($form, $data);
4041

4142
$filter = new FixUrlProtocolListener('http');
4243
$filter->onSubmit($event);
4344

44-
$this->assertEquals('http://www.symfony.com', $event->getData());
45+
$this->assertEquals('http://'.$data, $event->getData());
4546
}
4647

47-
public function provideUrlsWithSupportedProtocols()
48+
public function provideUrlToSkip()
4849
{
4950
return [
51+
['http://www.symfony.com'],
5052
['ftp://www.symfony.com'],
53+
['https://twitter.com/@symfony'],
5154
['chrome-extension://foo'],
5255
['h323://foo'],
5356
['iris.beep://foo'],
5457
['foo+bar://foo'],
58+
['fabien@symfony.com'],
5559
];
5660
}
5761

5862
/**
59-
* @dataProvider provideUrlsWithSupportedProtocols
63+
* @dataProvider provideUrlToSkip
6064
*/
61-
public function testSkipOtherProtocol($url)
65+
public function testSkipUrl($url)
6266
{
6367
$form = new Form(new FormConfigBuilder('name', null, new EventDispatcher()));
6468
$event = new FormEvent($form, $url);

0 commit comments

Comments
 (0)
0