8000 Merge branch '4.0' · symfony/symfony@ddb602b · GitHub
[go: up one dir, main page]

Skip to content

Commit ddb602b

Browse files
Merge branch '4.0'
* 4.0: fix merge fixed wrong description in a phpdoc 19 digits VISA card numbers are valid Add missing @ in phpdoc return statement Don't right trim the deprecation message [HttpKernel] Fixed test name [Debug] prevent infinite loop with faulty exception handlers [FrameworkBundle] fix tests Prefer composer install instead for using Symfony Installer Add the missing `enabled` session attribute [HttpKernel] Turn bad hosts into 400 instead of 500
2 parents 1df45e4 + c8d5dee commit ddb602b

File tree

12 files changed

+47
-17
lines changed

12 files changed

+47
-17
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ Drupal and Magento).
1010
Installation
1111
------------
1212

13-
* [Install Symfony][4] with Composer or with our own installer (see
14-
[requirements detail 8000 s][3]).
13+
* [Install Symfony][4] with Composer (see [requirements details][3]).
1514
* Symfony follows the [semantic versioning][5] strictly, publishes "Long Term
1615
Support" (LTS) versions and has a [release process][6] that is predictable and
1716
business-friendly.

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public static function register($mode = 0)
228228
uasort($deprecations[$group], $cmp);
229229

230230
foreach ($deprecations[$group] as $msg => $notices) {
231-
echo "\n", rtrim($msg, '.'), ': ', $notices['count'], "x\n";
231+
echo "\n ", $notices['count'], 'x: ', $msg, "\n";
232232

233233
arsort($notices);
234234

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,20 @@ $foo->testNonLegacyBar();
6363
--EXPECTF--
6464
Unsilenced deprecation notices (3)
6565

66-
unsilenced foo deprecation: 2x
66+
2x: unsilenced foo deprecation
6767
2x in FooTestCase::testLegacyFoo
6868

69-
unsilenced bar deprecation: 1x
69+
1x: unsilenced bar deprecation
7070
1x in FooTestCase::testNonLegacyBar
7171

7272
Remaining deprecation notices (1)
7373

74-
silenced bar deprecation: 1x
74+
1x: silenced bar deprecation
7575
1x in FooTestCase::testNonLegacyBar
7676

7777
Legacy deprecation notices (1)
7878

7979
Other deprecation notices (1)
8080

81-
root deprec 6D40 ation: 1x
81+
1x: root deprecation
8282

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ $foo->testNonLegacyBar();
5555
--EXPECTF--
5656
Unsilenced deprecation notices (3)
5757

58-
unsilenced foo deprecation: 2x
58+
2x: unsilenced foo deprecation
5959
2x in FooTestCase::testLegacyFoo
6060

61-
unsilenced bar deprecation: 1x
61+
1x: unsilenced bar deprecation
6262
1x in FooTestCase::testNonLegacyBar
6363

6464
Remaining deprecation notices (1)
6565

66-
silenced bar deprecation: 1x
66+
1x: silenced bar deprecation
6767
1x in FooTestCase::testNonLegacyBar
6868

6969
Legacy deprecation notices (1)
7070

7171
Other deprecation notices (1)
7272

73-
root deprecation: 1x
73+
1x: root deprecation
7474

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
</xsd:complexType>
104104

105105
<xsd:complexType name="session">
106+
<xsd:attribute name="enabled" type="xsd:boolean" />
106107
<xsd:attribute name="storage-id" type="xsd:string" />
107108
<xsd:attribute name="handler-id" type="xsd:string" />
108109
<xsd:attribute name="name" type="xsd:string" />

src/Symfony/Component/Cache/Adapter/AdapterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function getItem($key);
3131
/**
3232
* {@inheritdoc}
3333
*
34-
* return \Traversable|CacheItem[]
34+
* @return \Traversable|CacheItem[]
3535
*/
3636
public function getItems(array $keys = array());
3737
}

src/Symfony/Component/Console/Input/StringInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class StringInput extends ArgvInput
2828
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
2929

3030
/**
31-
* @param string $input An array of parameters from the CLI (in the argv format)
31+
* @param string $input A string representing the parameters from the CLI
3232
*/
3333
public function __construct(string $input)
3434
{

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,8 @@ public static function handleFatalError(array $error = null)
563563

564564
$handler = self::$reservedMemory = null;
565565
$handlers = array();
566+
$previousHandler = null;
567+
$sameHandlerLimit = 10;
566568

567569
while (!is_array($handler) || !$handler[0] instanceof self) {
568570
$handler = set_exception_handler('var_dump');
@@ -572,7 +574,14 @@ public static function handleFatalError(array $error = null)
572574
break;
573575
}
574576
restore_exception_handler();
575-
array_unshift($handlers, $handler);
577+
578+
if ($handler !== $previousHandler) {
579+
array_unshift($handlers, $handler);
580+
$previousHandler = $handler;
581+
} elseif (0 === --$sameHandlerLimit) {
582+
$handler = null;
583+
break;
584+
}
576585
}
577586
foreach ($handlers as $h) {
578587
set_exception_handler($h);

src/Symfony/Component/HttpKernel/EventListener/RouterListener.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
1818
use Symfony\Component\HttpKernel\Kernel;
1919
use Symfony\Component\HttpKernel\KernelEvents;
20+
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
2021
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
2122
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
2223
use Symfony\Component\HttpFoundation\RequestStack;
@@ -76,7 +77,11 @@ public function __construct($matcher, RequestStack $requestStack, RequestContext
7677
private function setCurrentRequest(Request $request = null)
7778
{
7879
if (null !== $request) {
79-
$this->context->fromRequest($request);
80+
try {
81+
$this->context->fromRequest($request);
82+
} catch (\UnexpectedValueException $e) {
83+
throw new BadRequestHttpException($e->getMessage(), $e, $e->getCode());
84+
}
8085
}
8186
}
8287

src/Symfony/Component/HttpKernel/Tests/EventListener/RouterListenerTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,19 @@ public function testNoRoutingConfigurationResponse()
203203
$this->assertSame(404, $response->getStatusCode());
204204
$this->assertContains('Welcome', $response->getContent());
205205
}
206+
207+
/**
208+
* @expectedException \Symfony\Component\HttpKernel\Exception\BadRequestHttpException
209+
*/
210+
public function testRequestWithBadHost()
211+
{
212+
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
213+
$request = Request::create('http://bad host %22/');
214+
$event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
215+
216+
$requestMatcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\RequestMatcherInterface')->getMock();
217+
218+
$listener = new RouterListener($requestMatcher, $this->requestStack, new RequestContext());
219+
$listener->onKernelRequest($event);
220+
}
206221
}

src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ class CardSchemeValidator extends ConstraintValidator
7878
'/^5[1-5][0-9]{14}$/',
7979
'/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/',
8080
),
81-
// All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13.
81+
// All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits.
8282
'VISA' => array(
83-
'/^4([0-9]{12}|[0-9]{15})$/',
83+
'/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/',
8484
),
8585
);
8686

src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public function getValidNumbers()
106106
array('VISA', '4111111111111111'),
107107
array('VISA', '4012888888881881'),
108108
array('VISA', '4222222222222'),
109+
array('VISA', '4917610000000000003'),
109110
array(array('AMEX', 'VISA'), '4111111111111111'),
110111
array(array('AMEX', 'VISA'), '378282246310005'),
111112
array(array('JCB', 'MASTERCARD'), '5105105105105100'),

0 commit comments

Comments
 (0)
0