Skip to content

Commit 5912413

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: [DI] minor FileLoaders tests update [HttpKernel] Revert BC breaking change of Request::isMethodSafe() [DOMCrawler] Bug fixed [Process] Do feat test before enabling TTY mode bumped Symfony version to 2.7.22 updated VERSION for 2.7.21 update CONTRIBUTORS for 2.7.21 updated CHANGELOG for 2.7.21 [Doctrine][Form] support large integers
2 parents adaa8ec + 34b9fd6 commit 5912413

File tree

14 files changed

+74
-29
lines changed

14 files changed

+74
-29
lines changed

CHANGELOG-2.7.md

+18
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ in 2.7 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/v2.7.0...v2.7.1
99

10+
* 2.7.21 (2016-11-21)
11+
12+
* bug #20543 [DI] Fix error when trying to resolve a DefinitionDecorator (nicolas-grekas)
13+
* bug #20484 bumped min version of Twig to 1.28 (fabpot)
14+
* bug #20519 [Debug] Remove GLOBALS from exception context to avoid endless recursion (Seldaek)
15+
* bug #20455 [ClassLoader] Fix ClassCollectionLoader inlining with __halt_compiler (giosh94mhz)
16+
* bug #20307 [Form] Fix Date\TimeType marked as invalid on request with single_text and zero seconds (LuisDeimos)
17+
* bug #20466 [Translation] fixed nested fallback catalogue using multiple locales. (aitboudad)
18+
* bug #20465 [#18637][TranslationDebug] workaround for getFallbackLocales. (aitboudad)
19+
* bug #20440 [TwigBridge][TwigBundle][HttpKernel] prefer getSourceContext() over getSource() (xabbuh)
20+
* bug #20422 [Translation][fallback] add missing resources in parent catalogues. (aitboudad)
21+
* bug #20378 [Form] Fixed show float values as choice value in ChoiceType (yceruto)
22+
* bug #20375 [HttpFoundation][Session] Fix memcache session handler (klandaika)
23+
* bug #20377 [Console] Fix infinite loop on missing input (chalasr)
24+
* bug #20342 [Form] Fix UrlType transforms valid protocols (ogizanagi)
25+
* bug #20292 Enhance GAE compat by removing some realpath() (nicolas-grekas)
26+
* bug #20321 Compatibility with Twig 1.27 (xkobal)
27+
1028
* 2.7.20 (2016-10-27)
1129

1230
* bug #20289 Fix edge case with StreamedResponse where headers are sent twice (Nicofuma)

CONTRIBUTORS.md

+21-11
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ Symfony is the result of the work of many people who made the code better
2222
- Abdellatif Ait boudad (aitboudad)
2323
- Pascal Borreli (pborreli)
2424
- Wouter De Jong (wouterj)
25-
- Joseph Bielawski (stloyd)
2625
- Romain Neutron (romain)
26+
- Joseph Bielawski (stloyd)
2727
- Karma Dordrak (drak)
2828
- Lukas Kahwe Smith (lsmith)
2929
- Martin Hasoň (hason)
3030
- Jeremy Mikola (jmikola)
3131
- Jean-François Simon (jfsimon)
32+
- Grégoire Pineau (lyrixx)
3233
- Benjamin Eberlei (beberlei)
3334
- Igor Wiedler (igorw)
34-
- Grégoire Pineau (lyrixx)
3535
- Eriksen Costa (eriksencosta)
3636
- Jules Pietri (heah)
3737
- Sarah Khalil (saro0h)
@@ -45,11 +45,11 @@ Symfony is the result of the work of many people who made the code better
4545
- stealth35 ‏ (stealth35)
4646
- Alexander Mols (asm89)
4747
- Bulat Shakirzyanov (avalanche123)
48+
- Robin Chalas (chalas_r)
4849
- Saša Stamenković (umpirsky)
4950
- Henrik Bjørnskov (henrikbjorn)
5051
- Miha Vrhovnik
5152
- Diego Saint Esteben (dii3g0)
52-
- Robin Chalas (chalas_r)
5353
- Ener-Getick (energetick)
5454
- Konstantin Kudryashov (everzet)
5555
- Bilal Amarni (bamarni)
@@ -84,19 +84,19 @@ Symfony is the result of the work of many people who made the code better
8484
- Fran Moreno (franmomu)
8585
- Antoine Hérault (herzult)
8686
- Paráda József (paradajozsef)
87+
- Roland Franssen (ro0)
88+
- Dariusz Ruminski
8789
- Jáchym Toušek (enumag)
8890
- Arnaud Le Blanc (arnaud-lb)
8991
- Jérôme Tamarelle (gromnan)
9092
- Michal Piotrowski (eventhorizon)
9193
- Tim Nagel (merk)
92-
- Dariusz Ruminski
9394
- Brice BERNARD (brikou)
9495
- Alexander M. Turek (derrabus)
9596
- marc.weistroff
9697
- Issei Murasawa (issei_m)
9798
- lenar
9899
- Włodzimierz Gajda (gajdaw)
99-
- Roland Franssen (ro0)
100100
- Baptiste Clavié (talus)
101101
- Alexander Schwenn (xelaris)
102102
- Florian Voutzinos (florianv)
@@ -132,6 +132,7 @@ Symfony is the result of the work of many people who made the code better
132132
- Rafael Dohms (rdohms)
133133
- Arnaud Kleinpeter (nanocom)
134134
- jwdeitch
135+
- Tobias Nyholm (tobias)
135136
- Joel Wurtz (brouznouf)
136137
- Philipp Wahala (hifi)
137138
- Vyacheslav Pavlov
@@ -145,12 +146,14 @@ Symfony is the result of the work of many people who made the code better
145146
- Clemens Tolboom
146147
- Helmer Aaviksoo
147148
- Hiromi Hishida (77web)
149+
- Yonel Ceruto González (yonelceruto)
148150
- Richard van Laak (rvanlaak)
149151
- Matthieu Ouellette-Vachon (maoueh)
150152
- Michał Pipa (michal.pipa)
151153
- Amal Raghav (kertz)
152154
- Jonathan Ingram (jonathaningram)
153155
- Artur Kotyrba
156+
- jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent)
154157
- Warnar Boekkooi (boekkooi)
155158
- Dmitrii Chekaliuk (lazyhammer)
156159
- Clément JOBEILI (dator)
@@ -160,13 +163,12 @@ Symfony is the result of the work of many people who made the code better
160163
- Richard Miller (mr_r_miller)
161164
- Mario A. Alvarez Garcia (nomack84)
162165
- Dennis Benkert (denderello)
163-
- jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent)
164166
- Benjamin Dulau (dbenjamin)
165167
- Mathieu Lemoine (lemoinem)
166168
- Andreas Hucks (meandmymonkey)
167169
- Noel Guilbert (noel)
168170
- Lars Strojny (lstrojny)
169-
- Yonel Ceruto González (yonelceruto)
171+
- Maxime STEINHAUSSER
170172
- Stepan Anchugov (kix)
171173
- bronze1man
172174
- sun (sun)
@@ -236,7 +238,6 @@ Symfony is the result of the work of many people who made the code better
236238
- Grégoire Paris (greg0ire)
237239
- Leo Feyer
238240
- Chekote
239-
- Tobias Nyholm (tobias)
240241
- Thomas Adam
241242
- Albert Casademont (acasademont)
242243
- Jhonny Lidfors (jhonne)
@@ -245,6 +246,7 @@ Symfony is the result of the work of many people who made the code better
245246
- Nikita Konstantinov
246247
- Wodor Wodorski
247248
- Thomas Lallement (raziel057)
249+
- Giorgio Premi
248250
- Matthieu Napoli (mnapoli)
249251
- Beau Simensen (simensen)
250252
- Michael Hirschler (mvhirsch)
@@ -295,7 +297,6 @@ Symfony is the result of the work of many people who made the code better
295297
- Mark Challoner (markchalloner)
296298
- Gregor Harlan (gharlan)
297299
- Gennady Telegin (gtelegin)
298-
- Giorgio Premi
299300
- Ben Davies (bendavies)
300301
- Erin Millard
301302
- Artur Melo (restless)
@@ -393,7 +394,6 @@ Symfony is the result of the work of many people who made the code better
393394
- Christian Schmidt
394395
- Marcin Sikoń (marphi)
395396
- Dominik Zogg (dominik.zogg)
396-
- Maxime STEINHAUSSER
397397
- Marek Pietrzak
398398
- Chad Sikorra (chadsikorra)
399399
- franek (franek)
@@ -439,6 +439,7 @@ Symfony is the result of the work of many people who made the code better
439439
- Vicent Soria Durá (vicentgodella)
440440
- Nicolas Dewez (nicolas_dewez)
441441
- Anthony Ferrara
442+
- Victor Bocharsky (bocharsky_bw)
442443
- Ioan Negulescu
443444
- Jakub Škvára (jskvara)
444445
- Andrew Udvare (audvare)
@@ -611,7 +612,6 @@ Symfony is the result of the work of many people who made the code better
611612
- Andrew Tchircoff (andrewtch)
612613
- michaelwilliams
613614
- 1emming
614-
- Victor Bocharsky (bocharsky_bw)
615615
- Leevi Graham (leevigraham)
616616
- Jordan Deitch
617617
- Casper Valdemar Poulsen
@@ -769,6 +769,7 @@ Symfony is the result of the work of many people who made the code better
769769
- fabios
770770
- Sander Coolen (scoolen)
771771
- Nicolas Le Goff (nlegoff)
772+
- Andreas Braun
772773
- Ben Oman
773774
- Manuele Menozzi
774775
- Anton Babenko (antonbabenko)
@@ -858,6 +859,7 @@ Symfony is the result of the work of many people who made the code better
858859
- rpg600
859860
- Péter Buri (burci)
860861
- Davide Borsatto (davide.borsatto)
862+
- Indra Gunawan (guind)
861863
- kaiwa
862864
- Charles Sanquer (csanquer)
863865
- Albert Ganiev (helios-ag)
@@ -969,6 +971,7 @@ Symfony is the result of the work of many people who made the code better
969971
- Sandro Hopf
970972
- Łukasz Makuch
971973
- George Giannoulopoulos
974+
- Luis Ramirez (luisdeimos)
972975
- Daniel Richter (richtermeister)
973976
- ChrisC
974977
- Ilya Biryukov
@@ -985,6 +988,7 @@ Symfony is the result of the work of many people who made the code better
985988
- Pete Mitchell (peterjmit)
986989
- Tom Corrigan (tomcorrigan)
987990
- Martin Pärtel
991+
- Noah Heck (myesain)
988992
- Patrick Daley (padrig)
989993
- Xavier Briand (xavierbriand)
990994
- Max Summe
@@ -1041,6 +1045,7 @@ Symfony is the result of the work of many people who made the code better
10411045
- Sebastian Ionescu
10421046
- Thomas Ploch
10431047
- Simon Neidhold
1048+
- Xavier HAUSHERR
10441049
- Valentin VALCIU
10451050
- Kevin Dew
10461051
- James Cowgill
@@ -1163,6 +1168,7 @@ Symfony is the result of the work of many people who made the code better
11631168
- Koalabaerchen
11641169
- michalmarcinkowski
11651170
- Warwick
1171+
- VJ
11661172
- Chris
11671173
- JakeFr
11681174
- Simon Sargeant
@@ -1236,6 +1242,7 @@ Symfony is the result of the work of many people who made the code better
12361242
- Joel Marcey
12371243
- David Christmann
12381244
- root
1245+
- Wouter J
12391246
- James Hudson
12401247
- Tom Maguire
12411248
- David Zuelke
@@ -1312,6 +1319,7 @@ Symfony is the result of the work of many people who made the code better
13121319
- Jelle Bekker (jbekker)
13131320
- Ian Jenkins (jenkoian)
13141321
- Jorge Martin (jorgemartind)
1322+
- Julien Falque (julienfalque)
13151323
- Kevin Herrera (kherge)
13161324
- Luis Ramón López López (lrlopez)
13171325
- Muriel (metalmumu)
@@ -1379,6 +1387,7 @@ Symfony is the result of the work of many people who made the code better
13791387
- Jörg Rühl
13801388
- wesleyh
13811389
- sergey
1390+
- Karim Miladi
13821391
- Michael Genereux
13831392
- patrick-mcdougle
13841393
- Dariusz Czech
@@ -1559,6 +1568,7 @@ Symfony is the result of the work of many people who made the code better
15591568
- Sergey Fedotov
15601569
- Michael
15611570
1571+
- Jan Emrich
15621572
- Mark Topper
15631573
- Xavier REN
15641574
- Zander Baldwin

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function getEntitiesByIds($identifier, array $values)
104104
// Filter out non-integer values (e.g. ""). If we don't, some
105105
// databases such as PostgreSQL fail.
106106
$values = array_values(array_filter($values, function ($v) {
107-
return (string) $v === (string) (int) $v;
107+
return (string) $v === (string) (int) $v || ctype_digit($v);
108108
}));
109109
} elseif ('guid' === $metadata->getTypeOfField($identifier)) {
110110
$parameterType = Connection::PARAM_STR_ARRAY;

src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/ORMQueryBuilderLoaderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function testFilterNonIntegerValues()
8787

8888
$query->expects($this->once())
8989
->method('setParameter')
90-
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', array(1, 2, 3), Connection::PARAM_INT_ARRAY)
90+
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', array(1, 2, 3, '9223372036854775808'), Connection::PARAM_INT_ARRAY)
9191
->willReturn($query);
9292

9393
$qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder')
@@ -103,7 +103,7 @@ public function testFilterNonIntegerValues()
103103
->from('Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity', 'e');
104104

105105
$loader = new ORMQueryBuilderLoader($qb);
106-
$loader->getEntitiesByIds('id', array(1, '', 2, 3, 'foo'));
106+
$loader->getEntitiesByIds('id', array(1, '', 2, 3, 'foo', '9223372036854775808'));
107107
}
108108

109109
public function testEmbeddedIdentifierName()

src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ public function testLoadImports()
131131
{
132132
$container = new ContainerBuilder();
133133
$resolver = new LoaderResolver(array(
134-
new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')),
135-
new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')),
134+
new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/ini')),
135+
new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yml')),
136136
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')),
137137
));
138138
$loader->setResolver($resolver);

src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public function testLoadImports()
104104
{
105105
$container = new ContainerBuilder();
106106
$resolver = new LoaderResolver(array(
107-
new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')),
108-
new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')),
107+
new IniFileLoader($container, new FileLocator(self::$fixturesPath.'/ini')),
108+
new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml')),
109109
new PhpFileLoader($container, new FileLocator(self::$fixturesPath.'/php')),
110110
$loader = new YamlFileLoader($container, new FileLocator(self::$fixturesPath.'/yaml')),
111111
));

src/Symfony/Component/DomCrawler/Crawler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ public static function xpathLiteral($s)
830830
}
831831
}
832832

833-
return sprintf('concat(%s)', implode($parts, ', '));
833+
return sprintf('concat(%s)', implode(', ', $parts));
834834
}
835835

836836
/**

src/Symfony/Component/HttpFoundation/BinaryFileResponse.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function prepare(Request $request)
190190

191191
if (!$this->headers->has('Accept-Ranges')) {
192192
// Only accept ranges on safe HTTP methods
193-
$this->headers->set('Accept-Ranges', $request->isMethodSafe() ? 'bytes' : 'none');
193+
$this->headers->set('Accept-Ranges', $request->isMethodSafe(false) ? 'bytes' : 'none');
194194
}
195195

196196
if (!$this->headers->has('Content-Type')) {

src/Symfony/Component/HttpFoundation/Request.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -1472,11 +1472,13 @@ public function isMethod($method)
14721472
/**
14731473
* Checks whether the method is safe or not.
14741474
*
1475+
* @param bool $andCacheable Adds the additional condition that the method should be cacheable. True by default.
1476+
*
14751477
* @return bool
14761478
*/
1477-
public function isMethodSafe()
1479+
public function isMethodSafe(/* $andCacheable = true */)
14781480
{
1479-
return in_array($this->getMethod(), array('GET', 'HEAD', 'OPTIONS', 'TRACE'));
1481+
return in_array($this->getMethod(), 0 < func_num_args() && !func_get_arg(0) ? array('GET', 'HEAD', 'OPTIONS', 'TRACE') : array('GET', 'HEAD'));
14801482
}
14811483

14821484
/**

src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ public function testMethodSafe($method, $safe)
19291929
{
19301930
$request = new Request();
19311931
$request->setMethod($method);
1932-
$this->assertEquals($safe, $request->isMethodSafe());
1932+
$this->assertEquals($safe, $request->isMethodSafe(false));
19331933
}
19341934

19351935
public function methodSafeProvider()
@@ -1948,6 +1948,13 @@ public function methodSafeProvider()
19481948
);
19491949
}
19501950

1951+
public function testMethodSafeChecksCacheable()
1952+
{
1953+
$request = new Request();
1954+
$request->setMethod('OPTION');
1955+
$this->assertFalse($request->isMethodSafe());
1956+
}
1957+
19511958
/**
19521959
* @dataProvider methodCacheableProvider
19531960
*/

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function onKernelRequest(GetResponseEvent $event)
8181
protected function validateRequest(Request $request)
8282
{
8383
// is the Request safe?
84-
if (!$request->isMethodSafe()) {
84+
if (!$request->isMethodSafe(false)) {
8585
throw new AccessDeniedHttpException();
8686
}
8787

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
202202
}
203203
$this->traces[$request->getMethod().' '.$path] = array();
204204

205-
if (!$request->isMethodSafe()) {
205+
if (!$request->isMethodSafe(false)) {
206206
$response = $this->invalidate($request, $catch);
207207
} elseif ($request->headers->has('expect') || !$request->isMethodCacheable()) {
208208
$response = $this->pass($request, $catch);

src/Symfony/Component/Process/Process.php

+11-3
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,16 @@ public function setTty($tty)
911911
if ('\\' === DIRECTORY_SEPARATOR && $tty) {
912912
throw new RuntimeException('TTY mode is not supported on Windows platform.');
913913
}
914-
if ($tty && (!file_exists('/dev/tty') || !is_readable('/dev/tty'))) {
915-
throw new RuntimeException('TTY mode requires /dev/tty to be readable.');
914+
if ($tty) {
915+
static $isTtySupported;
916+
917+
if (null === $isTtySupported) {
918+
$isTtySupported = (bool) @proc_open('echo 1 >/dev/null', array(array('file', '/dev/tty', 'r'), array('file', '/dev/tty', 'w'), array('file', '/dev/tty', 'w')), $pipes);
919+
}
920+
921+
if (!$isTtySupported) {
922+
throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.');
923+
}
916924
}
917925

918926
$this->tty = (bool) $tty;
@@ -1214,7 +1222,7 @@ public static function isPtySupported()
12141222
return $result = false;
12151223
}
12161224

1217-
return $result = (bool) @proc_open('echo 1', array(array('pty'), array('pty'), array('pty')), $pipes);
1225+
return $result = (bool) @proc_open('echo 1 >/dev/null', array(array('pty'), array('pty'), array('pty')), $pipes);
12181226
}
12191227

12201228
/**

0 commit comments

Comments
 (0)