Skip to content

Commit 36b5716

Browse files
Merge branch '2.8' into 3.1
* 2.8: Disable CLI color for Windows 10 greater than 10.0.10586 Exception details break the layout [HttpKernel] Remove wrong docblock [HttpKernel] Fix HttpCache validation HTTP method Move space from the before 'if' to the after 'if' [TwigBundle] Add a check for choice's attributes emptiness before calling block('attributes')
2 parents a7bd135 + 93e8b1d commit 36b5716

File tree

8 files changed

+32
-20
lines changed

8 files changed

+32
-20
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private static function hasColorSupport()
195195
{
196196
if ('\\' === DIRECTORY_SEPARATOR) {
197197
return
198-
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
198+
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
199199
|| false !== getenv('ANSICON')
200200
|| 'ON' === getenv('ConEmuANSI')
201201
|| 'xterm' === getenv('TERM');

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@
7979
{{- block('choice_widget_options') -}}
8080
</optgroup>
8181
{%- else -%}
82-
{% set attr = choice.attr %}
83-
<option value="{{ choice.value }}" {{ block('attributes') }}{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice_translation_domain is same as(false) ? choice.label : choice.label|trans({}, choice_translation_domain) }}</option>
82+
<option value="{{ choice.value }}"{% if choice.attr %} {% set attr = choice.attr %}{{ block('attributes') }}{% endif %}{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice_translation_domain is same as(false) ? choice.label : choice.label|trans({}, choice_translation_domain) }}</option>
8483
{%- endif -%}
8584
{% endfor %}
8685
{%- endblock choice_widget_options -%}

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function doWrite($message, $newline)
8585
*
8686
* Colorization is disabled if not supported by the stream:
8787
*
88-
* - Windows before 10.0.10586 without Ansicon, ConEmu or Mintty
88+
* - Windows != 10.0.10586 without Ansicon, ConEmu or Mintty
8989
* - non tty consoles
9090
*
9191
* @return bool true if the stream supports colorization, false otherwise
@@ -94,7 +94,7 @@ protected function hasColorSupport()
9494
{
9595
if (DIRECTORY_SEPARATOR === '\\') {
9696
return
97-
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
97+
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
9898
|| false !== getenv('ANSICON')
9999
|| 'ON' === getenv('ConEmuANSI')
100100
|| 'xterm' === getenv('TERM');

src/Symfony/Component/Debug/ExceptionHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ public function getStylesheet(FlattenException $exception)
299299
border-bottom:1px solid #ccc;
300300
border-right:1px solid #ccc;
301301
border-left:1px solid #ccc;
302+
word-wrap: break-word;
302303
}
303304
.sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px;
304305
-webkit-border-top-left-radius: 16px;

src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,6 @@ public function lateCollect()
6868
}
6969
}
7070

71-
/**
72-
* Gets the called events.
73-
*
74-
* @return array An array of called events
75-
*
76-
* @see TraceableEventDispatcherInterface
77-
*/
78-
public function countErrors()
79-
{
80-
return isset($this->data['error_count']) ? $this->data['error_count'] : 0;
81-
}
82-
8371
/**
8472
* Gets the logs.
8573
*
@@ -95,6 +83,11 @@ public function getPriorities()
9583
return isset($this->data['priorities']) ? $this->data['priorities'] : array();
9684
}
9785

86+
public function countErrors()
87+
{
88+
return isset($this->data['error_count']) ? $this->data['error_count'] : 0;
89+
}
90+
9891
public function countDeprecations()
9992
{
10093
return isset($this->data['deprecation_count']) ? $this->data['deprecation_count'] : 0;

src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@ protected function validate(Request $request, Response $entry, $catch = false)
354354
$subRequest = clone $request;
355355

356356
// send no head requests because we want content
357-
$subRequest->setMethod('GET');
357+
if ('HEAD' === $request->getMethod()) {
358+
$subRequest->setMethod('GET');
359+
}
358360

359361
// add our cached last-modified validator
360362
$subRequest->headers->set('if_modified_since', $entry->headers->get('Last-Modified'));
@@ -415,7 +417,9 @@ protected function fetch(Request $request, $catch = false)
415417
$subRequest = clone $request;
416418

417419
// send no head requests because we want content
418-
$subRequest->setMethod('GET');
420+
if ('HEAD' === $request->getMethod()) {
421+
$subRequest->setMethod('GET');
422+
}
419423

420424
// avoid that the backend sends no content
421425
$subRequest->headers->remove('if_modified_since');

src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,21 @@ public function testValidatesCachedResponsesWithLastModifiedAndNoFreshnessInform
799799
$this->assertTraceNotContains('miss');
800800
}
801801

802+
public function testValidatesCachedResponsesUseSameHttpMethod()
803+
{
804+
$test = $this;
805+
806+
$this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($test) {
807+
$test->assertSame('OPTIONS', $request->getMethod());
808+
});
809+
810+
// build initial request
811+
$this->request('OPTIONS', '/');
812+
813+
// build subsequent request
814+
$this->request('OPTIONS', '/');
815+
}
816+
802817
public function testValidatesCachedResponsesWithETagAndNoFreshnessInformation()
803818
{
804819
$this->setNextResponse(200, array(), 'Hello World', function ($request, $response) {

src/Symfony/Component/VarDumper/Dumper/CliDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ protected function supportsColors()
453453

454454
if ('\\' === DIRECTORY_SEPARATOR) {
455455
static::$defaultColors = @(
456-
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
456+
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
457457
|| false !== getenv('ANSICON')
458458
|| 'ON' === getenv('ConEmuANSI')
459459
|| 'xterm' === getenv('TERM')

0 commit comments

Comments
 (0)