Skip to content

Commit 93e8b1d

Browse files
Merge branch '2.7' into 2.8
* 2.7: 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 609ee2d + 2909e4b commit 93e8b1d

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
@@ -342,6 +342,7 @@ public function getStylesheet(FlattenException $exception)
342342
border-bottom:1px solid #ccc;
343343
border-right:1px solid #ccc;
344344
border-left:1px solid #ccc;
345+
word-wrap: break-word;
345346
}
346347
.sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px;
347348
-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
@@ -374,7 +374,9 @@ protected function validate(Request $request, Response $entry, $catch = false)
374374
$subRequest = clone $request;
375375

376376
// send no head requests because we want content
377-
$subRequest->setMethod('GET');
377+
if ('HEAD' === $request->getMethod()) {
378+
$subRequest->setMethod('GET');
379+
}
378380

379381
// add our cached last-modified validator
380382
$subRequest->headers->set('if_modified_since', $entry->headers->get('Last-Modified'));
@@ -435,7 +437,9 @@ protected function fetch(Request $request, $catch = false)
435437
$subRequest = clone $request;
436438

437439
// send no head requests because we want content
438-
$subRequest->setMethod('GET');
440+
if ('HEAD' === $request->getMethod()) {
441+
$subRequest->setMethod('GET');
442+
}
439443

440444
// avoid that the backend sends no content
441445
$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
@@ -447,7 +447,7 @@ protected function supportsColors()
447447

448448
if ('\\' === DIRECTORY_SEPARATOR) {
449449
static::$defaultColors = @(
450-
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
450+
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
451451
|| false !== getenv('ANSICON')
452452
|| 'ON' === getenv('ConEmuANSI')
453453
|| 'xterm' === getenv('TERM')

0 commit comments

Comments
 (0)