Skip to content

Commit de03922

Browse files
Merge branch '3.0' into 3.1
* 3.0: (25 commits) Fix merge [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5 [Console] fixed PHPDoc [travis] HHVM 3.12 LTS Fix feature detection for IE [Form] Fixed collapsed choice attributes [Console] added explanation of messages usage in a progress bar force enabling the external XML entity loaders [Yaml] properly count skipped comment lines [WebProfilerBundle] Fix invalid CSS style Added progressive jpeg to mime types guesser [Yaml] Fix wrong line number when comments are inserted in the middle of a block. Fixed singular of committee Do not inject web debug toolbar on attachments bumped Symfony version to 3.0.8 updated VERSION for 3.0.7 updated CHANGELOG for 3.0.7 bumped Symfony version to 2.8.8 updated VERSION for 2.8.7 updated CHANGELOG for 2.8.7 ... Conflicts: src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/PropertyAccess/StringUtil.php src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php src/Symfony/Component/Yaml/Parser.php src/Symfony/Component/Yaml/Tests/ParserTest.php
2 parents a80fa41 + a7ed68b commit de03922

File tree

29 files changed

+426
-65
lines changed

29 files changed

+426
-65
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
matrix:
2121
include:
2222
# Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
23-
- php: hhvm
23+
- php: hhvm-3.12
2424
sudo: required
2525
dist: trusty
2626
group: edge

CHANGELOG-3.0.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,37 @@ in 3.0 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.0.0...v3.0.1
99

10+
* 3.0.7 (2016-06-06)
11+
12+
* bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh)
13+
* bug #18893 [DependencyInjection] Skip deep reference check for 'service_container' (RobertMe)
14+
* bug #18812 Catch \Throwable (fprochazka)
15+
* bug #18821 [Form] Removed UTC specification with timestamp (francisbesset)
16+
* bug #18861 Fix for #18843 (inso)
17+
* bug #18889 [Console] SymfonyStyle: Fix alignment/prefixing of multi-line comments (chalasr)
18+
* bug #18907 [Routing] Fix the annotation loader taking a class constant as a beginning of a class name (jakzal, nicolas-grekas)
19+
* bug #18879 [Console] SymfonyStyle: Align multi-line/very-long-line blocks (chalasr)
20+
* bug #18864 [Console][DX] Fixed ambiguous error message when using a duplicate option shortcut (peterrehm)
21+
* bug #18883 Fix js comment in profiler (linnaea)
22+
* bug #18844 [Yaml] fix exception contexts (xabbuh)
23+
* bug #18840 [Yaml] properly handle unindented collections (xabbuh)
24+
* bug #18765 Catch \Throwable (fprochazka)
25+
* bug #18813 Catch \Throwable (fprochazka)
26+
* bug #18839 People - person singularization (Keeo)
27+
* bug #18828 [Yaml] chomp newlines only at the end of YAML documents (xabbuh)
28+
* bug #18814 Fixed server status command when port has been omitted (peterrehm)
29+
* bug #18759 [Validator] Support for DateTimeImmutable (krzysiekpiasecki)
30+
* bug #18799 Use levenshtein level for better Bundle matching (j0k3r)
31+
* bug #18413 [WebProfilerBundle] Fix CORS ajax security issues (romainneutron)
32+
* bug #18774 [console][table] adjust width of colspanned cell. (aitboudad)
33+
* bug #18507 [BUG] Delete class 'control-group' in bootstrap 3 (Philippe Degeeter)
34+
* bug #18747 [Form] Modified iterator_to_array's 2nd parameter to false in ViolationMapper (issei-m)
35+
* bug #18635 [Console] Prevent fatal error when calling Command::getHelper without helperSet (chalasr)
36+
* bug #18686 [console][table] adjust width of colspanned cell. (aitboudad)
37+
* bug #18761 [Form] Modified iterator_to_array's 2nd parameter to false in ViolationMapper (issei-m)
38+
* bug #18745 [MonologBridge] Uninstallable together with symfony/http-kernel in 3.0.6 (ymc-dabe)
39+
* bug #18737 [Debug] Fix fatal error handlers on PHP 7 (nicolas-grekas)
40+
1041
* 3.0.6 (2016-05-10)
1142

1243
* security #18736 Fixed issue with blank password with Ldap (csarrazi)

CONTRIBUTORS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Symfony is the result of the work of many people who made the code better
3939
- Maxime Steinhausser (ogizanagi)
4040
- Alexandre Salomé (alexandresalome)
4141
- William Durand (couac)
42-
- ornicar
4342
- Jules Pietri (heah)
43+
- ornicar
4444
- stealth35 ‏ (stealth35)
4545
- Alexander Mols (asm89)
4646
- Francis Besset (francisbesset)
@@ -65,9 +65,9 @@ Symfony is the result of the work of many people who made the code better
6565
- Dariusz Górecki (canni)
6666
- Arnout Boks (aboks)
6767
- Iltar van der Berg (kjarli)
68+
- Charles Sarrazin (csarrazi)
6869
- Ener-Getick (energetick)
6970
- Douglas Greenshields (shieldo)
70-
- Charles Sarrazin (csarrazi)
7171
- Lee McDermott
7272
- Brandon Turner
7373
- Luis Cordova (cordoval)
@@ -187,6 +187,7 @@ Symfony is the result of the work of many people who made the code better
187187
- Loïc Faugeron
188188
- Jannik Zschiesche (apfelbox)
189189
- Marco Pivetta (ocramius)
190+
- Teoh Han Hui (teohhanhui)
190191
- julien pauli (jpauli)
191192
- Michael Lee (zerustech)
192193
- Lorenz Schori
@@ -213,6 +214,7 @@ Symfony is the result of the work of many people who made the code better
213214
- Pierre-Yves LEBECQ (pylebecq)
214215
- Daniel Espendiller
215216
- Jakub Kucharovic (jkucharovic)
217+
- Robin Chalas (chalas_r)
216218
- Eugene Leonovich (rybakit)
217219
- Filippo Tessarotto
218220
- Joseph Rouff (rouffj)
@@ -275,7 +277,6 @@ Symfony is the result of the work of many people who made the code better
275277
- janschoenherr
276278
- Thomas Schulz (king2500)
277279
- Berny Cantos (xphere81)
278-
- Teoh Han Hui (teohhanhui)
279280
- Ricard Clau (ricardclau)
280281
- Mark Challoner (markchalloner)
281282
- Gregor Harlan (gharlan)
@@ -310,7 +311,6 @@ Symfony is the result of the work of many people who made the code better
310311
- Philipp Kräutli (pkraeutli)
311312
- Kirill chEbba Chebunin (chebba)
312313
- Greg Thornton (xdissent)
313-
- Robin Chalas (chalas_r)
314314
- Costin Bereveanu (schniper)
315315
- Loïc Chardonnet (gnusat)
316316
- Marek Kalnik (marekkalnik)
@@ -1414,6 +1414,7 @@ Symfony is the result of the work of many people who made the code better
14141414
- Damon Jones (damon__jones)
14151415
- David Badura (davidbadura)
14161416
- Daniel Londero (dlondero)
1417+
- Sebastian Landwehr (dword123)
14171418
- Adel ELHAIBA (eadel)
14181419
- Damián Nohales (eagleoneraptor)
14191420
- Elliot Anderson (elliot)

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function write($sessionId, $data)
180180
$updateStmt->bindValue(':time', time(), \PDO::PARAM_INT);
181181
$updateStmt->execute();
182182

183-
// When MERGE is not supported, like in Postgres, we have to use this approach that can result in
183+
// When MERGE is not supported, like in Postgres < 9.5, we have to use this approach that can result in
184184
// duplicate key errors when the same session is written simultaneously. We can just catch such an
185185
// error and re-execute the update. This is similar to a serializable transaction with retry logic
186186
// on serialization failures but without the overhead and without possible false positives due to
@@ -224,11 +224,11 @@ private function getMergeSql()
224224
{
225225
$platform = $this->con->getDatabasePlatform()->getName();
226226

227-
switch ($platform) {
228-
case 'mysql':
227+
switch (true) {
228+
case 'mysql' === $platform:
229229
return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
230230
"ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->timeCol = VALUES($this->timeCol)";
231-
case 'oracle':
231+
case 'oracle' === $platform:
232232
// DUAL is Oracle specific dummy table
233233
return "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) ".
234234
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
@@ -239,8 +239,11 @@ private function getMergeSql()
239239
return "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) ".
240240
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
241241
"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time;";
242-
case 'sqlite':
242+
case 'sqlite' === $platform:
243243
return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)";
244+
case 'postgresql' === $platform && version_compare($this->con->getServerVersion(), '9.5', '>='):
245+
return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
246+
"ON CONFLICT ($this->idCol) DO UPDATE SET ($this->dataCol, $this->timeCol) = (:data, :time) WHERE $this->idCol = :id";
244247
}
245248
}
246249
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"
2+
<?php if ($disabled): ?>disabled="disabled" <?php endif ?>
3+
<?php foreach ($choice_attr as $k => $v): ?>
4+
<?php if ($v === true): ?>
5+
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
6+
<?php elseif ($v !== false): ?>
7+
<?php printf('%s="%s" ', $view->escape($k), $view->escape($v)) ?>
8+
<?php endif ?>
9+
<?php endforeach ?>

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_options.html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<?php echo $formHelper->block($form, 'choice_widget_options', array('choices' => $choice)) ?>
99
</optgroup>
1010
<?php else: ?>
11-
<option value="<?php echo $view->escape($choice->value) ?>" <?php echo $view['form']->block($form, 'attributes', array('attr' => $choice->attr)) ?><?php if ($is_selected($choice->value, $value)): ?> selected="selected"<?php endif?>><?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($choice->label, array(), $choice_translation_domain) : $choice->label) ?></option>
11+
<option value="<?php echo $view->escape($choice->value) ?>" <?php echo $formHelper->block($form, 'choice_attributes', array('choice_attr' => $choice->attr)) ?><?php if ($is_selected($choice->value, $value)): ?> selected="selected"<?php endif?>><?php echo $view->escape(false !== $choice_translation_domain ? $translatorHelper->trans($choice->label, array(), $choice_translation_domain) : $choice->label) ?></option>
1212
<?php endif ?>
1313
<?php endforeach ?>

src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function onKernelResponse(FilterResponseEvent $event)
9898
|| $response->isRedirection()
9999
|| ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))
100100
|| 'html' !== $request->getRequestFormat()
101+
|| false !== stripos($response->headers->get('Content-Disposition'), 'attachment;')
101102
) {
102103
return;
103104
}

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
var addEventListener;
225225
226226
var el = document.createElement('div');
227-
if (!'addEventListener' in el) {
227+
if (!('addEventListener' in el)) {
228228
addEventListener = function (element, eventName, callback) {
229229
element.attachEvent('on' + eventName, callback);
230230
};

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Router/panel.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<h3>Route Redirection</h3>
3131

3232
<p>This page redirects to:</p>
33-
<div class="card" style="break-long-words">
33+
<div class="card break-long-words">
3434
{{ router.targetUrl }}
3535
{% if router.targetRoute %}<span class="text-muted">(route: "{{ router.targetRoute }}")</span>{% endif %}
3636
</div>

src/Symfony/Bundle/WebProfilerBundle/Tests/EventListener/WebDebugToolbarListenerTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,21 @@ public function testToolbarIsInjected()
8282
$this->assertEquals("<html><head></head><body>\nWDT\n</body></html>", $response->getContent());
8383
}
8484

85+
/**
86+
* @depends testToolbarIsInjected
87+
*/
88+
public function testToolbarIsNotInjectedOnContentDispositionAttachment()
89+
{
90+
$response = new Response('<html><head></head><body></body></html>');
91+
$response->headers->set('Content-Disposition', 'attachment; filename=test.html');
92+
$event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(false, 'html'), HttpKernelInterface::MASTER_REQUEST, $response);
93+
94+
$listener = new WebDebugToolbarListener($this->getTwigMock());
95+
$listener->onKernelResponse($event);
96+
97+
$this->assertEquals('<html><head></head><body></body></html>', $response->getContent());
98+
}
99+
85100
/**
86101
* @depends testToolbarIsInjected
87102
* @dataProvider provideRedirects

0 commit comments

Comments
 (0)