Skip to content

Commit 08c869e

Browse files
committed
Merge branch '2.8' into 3.1
* 2.8: [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.8.15 updated VERSION for 2.8.14 updated CHANGELOG for 2.8.14 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 Fix annotation type for $context [Doctrine][Form] support large integers
2 parents 59e8f2f + 5912413 commit 08c869e

File tree

14 files changed

+57
-30
lines changed

14 files changed

+57
-30
lines changed

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
@@ -70,7 +70,7 @@ public function getEntitiesByIds($identifier, array $values)
7070
// Filter out non-integer values (e.g. ""). If we don't, some
7171
// databases such as PostgreSQL fail.
7272
$values = array_values(array_filter($values, function ($v) {
73-
return (string) $v === (string) (int) $v;
73+
return (string) $v === (string) (int) $v || ctype_digit($v);
7474
}));
7575
} elseif ('guid' === $metadata->getTypeOfField($identifier)) {
7676
$parameterType = Connection::PARAM_STR_ARRAY;

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

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

6868
$query->expects($this->once())
6969
->method('setParameter')
70-
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', array(1, 2, 3), Connection::PARAM_INT_ARRAY)
70+
->with('ORMQueryBuilderLoader_getEntitiesByIds_id', array(1, 2, 3, '9223372036854775808'), Connection::PARAM_INT_ARRAY)
7171
->willReturn($query);
7272

7373
$qb = $this->getMockBuilder('Doctrine\ORM\QueryBuilder')
@@ -83,7 +83,7 @@ public function testFilterNonIntegerValues()
8383
->from('Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity', 'e');
8484

8585
$loader = new ORMQueryBuilderLoader($qb);
86-
$loader->getEntitiesByIds('id', array(1, '', 2, 3, 'foo'));
86+
$loader->getEntitiesByIds('id', array(1, '', 2, 3, 'foo', '9223372036854775808'));
8787
}
8888

8989
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
@@ -900,7 +900,7 @@ public static function xpathLiteral($s)
900900
}
901901
}
902902

903-
return sprintf('concat(%s)', implode($parts, ', '));
903+
return sprintf('concat(%s)', implode(', ', $parts));
904904
}
905905

906906
/**

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
@@ -1475,11 +1475,13 @@ public function isMethod($method)
14751475
/**
14761476
* Checks whether the method is safe or not.
14771477
*
1478+
* @param bool $andCacheable Adds the additional condition that the method should be cacheable. True by default.
1479+
*
14781480
* @return bool
14791481
*/
1480-
public function isMethodSafe()
1482+
public function isMethodSafe(/* $andCacheable = true */)
14811483
{
1482-
return in_array($this->getMethod(), array('GET', 'HEAD', 'OPTIONS', 'TRACE'));
1484+
return in_array($this->getMethod(), 0 < func_num_args() && !func_get_arg(0) ? array('GET', 'HEAD', 'OPTIONS', 'TRACE') : array('GET', 'HEAD'));
14831485
}
14841486

14851487
/**

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -1968,7 +1968,7 @@ public function testMethodSafe($method, $safe)
19681968
{
19691969
$request = new Request();
19701970
$request->setMethod($method);
1971-
$this->assertEquals($safe, $request->isMethodSafe());
1971+
$this->assertEquals($safe, $request->isMethodSafe(false));
19721972
}
19731973

19741974
public function methodSafeProvider()
@@ -1987,6 +1987,13 @@ public function methodSafeProvider()
19871987
);
19881988
}
19891989

1990+
public function testMethodSafeChecksCacheable()
1991+
{
1992+
$request = new Request();
1993+
$request->setMethod('OPTION');
1994+
$this->assertFalse($request->isMethodSafe());
1995+
}
1996+
19901997
/**
19911998
* @dataProvider methodCacheableProvider
19921999
*/

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
@@ -182,7 +182,7 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
182182
}
183183
$this->traces[$request->getMethod().' '.$path] = array();
184184

185-
if (!$request->isMethodSafe()) {
185+
if (!$request->isMethodSafe(false)) {
186186
$response = $this->invalidate($request, $catch);
187187
} elseif ($request->headers->has('expect') || !$request->isMethodCacheable()) {
188188
$response = $this->pass($request, $catch);

src/Symfony/Component/Process/Process.php

+11-3
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,16 @@ public function setTty($tty)
976976
if ('\\' === DIRECTORY_SEPARATOR && $tty) {
977977
throw new RuntimeException('TTY mode is not supported on Windows platform.');
978978
}
979-
if ($tty && (!file_exists('/dev/tty') || !is_readable('/dev/tty'))) {
980-
throw new RuntimeException('TTY mode requires /dev/tty to be readable.');
979+
if ($tty) {
980+
static $isTtySupported;
981+
982+
if (null === $isTtySupported) {
983+
$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);
984+
}
985+
986+
if (!$isTtySupported) {
987+
throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.');
988+
}
981989
}
982990

983991
$this->tty = (bool) $tty;
@@ -1241,7 +1249,7 @@ public static function isPtySupported()
12411249
return $result = false;
12421250
}
12431251

1244-
return $result = (bool) @proc_open('echo 1', array(array('pty'), array('pty'), array('pty')), $pipes);
1252+
return $result = (bool) @proc_open('echo 1 >/dev/null', array(array('pty'), array('pty'), array('pty')), $pipes);
12451253
}
12461254

12471255
/**

src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private function startAuthentication(Request $request, AuthenticationException $
220220
protected function setTargetPath(Request $request)
221221
{
222222
// session isn't required when using HTTP basic authentication mechanism for example
223-
if ($request->hasSession() && $request->isMethodSafe() && !$request->isXmlHttpRequest()) {
223+
if ($request->hasSession() && $request->isMethodSafe(false) && !$request->isXmlHttpRequest()) {
224224
$this->saveTargetPath($request->getSession(), $this->providerKey, $request->getUri());
225225
}
226226
}

src/Symfony/Component/Validator/ConstraintValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface
3636
const OBJECT_TO_STRING = 2;
3737

3838
/**
39-
* @var ExecutionContextInterface
39+
* @var ExecutionContextInterface2Dot5
4040
*/
4141
protected $context;
4242

0 commit comments

Comments
 (0)