diff --git a/CHANGELOG-2.7.md b/CHANGELOG-2.7.md
index 70677f3d18e3d..6c8ff11ea85cb 100644
--- a/CHANGELOG-2.7.md
+++ b/CHANGELOG-2.7.md
@@ -7,6 +7,12 @@ in 2.7 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.7.0...v2.7.1
+* 2.7.45 (2018-04-06)
+
+ * bug #26763 [Finder] Remove duplicate slashes in filenames (helhum)
+ * bug #26749 Add PHPDbg support to HTTP components (hkdobrev)
+ * bug #26609 [Console] Fix check of color support on Windows (mlocati)
+
* 2.7.44 (2018-04-02)
* bug #26727 [HttpCache] Unlink tmp file on error (Chansig)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 1cb4373ec2030..57bd22e5c521d 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -14,14 +14,14 @@ Symfony is the result of the work of many people who made the code better
- Victor Berchet (victor)
- Kévin Dunglas (dunglas)
- Johannes S (johannes)
- - Jakub Zalas (jakubzalas)
- Robin Chalas (chalas_r)
+ - Jakub Zalas (jakubzalas)
- Kris Wallsmith (kriswallsmith)
- Ryan Weaver (weaverryan)
- Javier Eguiluz (javier.eguiluz)
- Maxime Steinhausser (ogizanagi)
- - Hugo Hamon (hhamon)
- Grégoire Pineau (lyrixx)
+ - Hugo Hamon (hhamon)
- Abdellatif Ait boudad (aitboudad)
- Romain Neutron (romain)
- Pascal Borreli (pborreli)
@@ -49,16 +49,16 @@ Symfony is the result of the work of many people who made the code better
- Iltar van der Berg (kjarli)
- stealth35 (stealth35)
- Alexander Mols (asm89)
+ - Samuel ROZE (sroze)
- Yonel Ceruto (yonelceruto)
- Bulat Shakirzyanov (avalanche123)
- Peter Rehm (rpet)
- Saša Stamenković (umpirsky)
- Matthias Pigulla (mpdude)
- - Samuel ROZE (sroze)
+ - Pierre du Plessis (pierredup)
- Henrik Bjørnskov (henrikbjorn)
- Dany Maillard (maidmaid)
- Miha Vrhovnik
- - Pierre du Plessis (pierredup)
- Tobias Nyholm (tobias)
- Diego Saint Esteben (dii3g0)
- Konstantin Kudryashov (everzet)
@@ -81,8 +81,8 @@ Symfony is the result of the work of many people who made the code better
- Deni
- Henrik Westphal (snc)
- Dariusz Górecki (canni)
- - Douglas Greenshields (shieldo)
- Issei Murasawa (issei_m)
+ - Douglas Greenshields (shieldo)
- Lee McDermott
- Brandon Turner
- Luis Cordova (cordoval)
@@ -94,10 +94,10 @@ Symfony is the result of the work of many people who made the code better
- Jordan Alliot (jalliot)
- Jérôme Tamarelle (gromnan)
- John Wards (johnwards)
+ - David Maicher (dmaicher)
- Fran Moreno (franmomu)
- Antoine Hérault (herzult)
- Paráda József (paradajozsef)
- - David Maicher (dmaicher)
- Vladimir Reznichenko (kalessil)
- Arnaud Le Blanc (arnaud-lb)
- Maxime STEINHAUSSER
@@ -148,6 +148,7 @@ Symfony is the result of the work of many people who made the code better
- Julien Falque (julienfalque)
- Rafael Dohms (rdohms)
- Arnaud Kleinpeter (nanocom)
+ - gadelat (gadelat)
- jwdeitch
- Mikael Pajunen
- Joel Wurtz (brouznouf)
@@ -158,7 +159,6 @@ Symfony is the result of the work of many people who made the code better
- Richard van Laak (rvanlaak)
- Richard Shank (iampersistent)
- Thomas Rabaix (rande)
- - gadelat (gadelat)
- Rouven Weßling (realityking)
- Teoh Han Hui (teohhanhui)
- Clemens Tolboom
@@ -292,6 +292,7 @@ Symfony is the result of the work of many people who made the code better
- Roumen Damianoff (roumen)
- Antonio J. García Lagar (ajgarlag)
- Kim Hemsø Rasmussen (kimhemsoe)
+ - Florent Mata (fmata)
- Wouter Van Hecke
- Jérôme Parmentier (lctrs)
- Michael Babker (mbabker)
@@ -371,13 +372,13 @@ Symfony is the result of the work of many people who made the code better
- Philipp Kräutli (pkraeutli)
- Kirill chEbba Chebunin (chebba)
- Greg Thornton (xdissent)
- - Florent Mata (fmata)
- Costin Bereveanu (schniper)
- Loïc Chardonnet (gnusat)
- Marek Kalnik (marekkalnik)
- Vyacheslav Salakhutdinov (megazoll)
- Hassan Amouhzi
- Tamas Szijarto
+ - Michele Locati
- Pavel Volokitin (pvolok)
- Arthur de Moulins (4rthem)
- Nicolas Dewez (nicolas_dewez)
@@ -435,6 +436,7 @@ Symfony is the result of the work of many people who made the code better
- Florian Pfitzer (marmelatze)
- Asier Illarramendi (doup)
- Andreas Braun
+ - Boris Vujicic (boris.vujicic)
- Chris Sedlmayr (catchamonkey)
- Seb Koelen
- Christoph Mewes (xrstf)
@@ -467,6 +469,7 @@ Symfony is the result of the work of many people who made the code better
- Roman Lapin (memphys)
- Yoshio HANAWA
- Gladhon
+ - Haralan Dobrev (hkdobrev)
- Sebastian Bergmann
- Miroslav Sustek
- Sullivan SENECHAL (soullivaneuh)
@@ -499,7 +502,6 @@ Symfony is the result of the work of many people who made the code better
- Andrew Udvare (audvare)
- alexpods
- Arjen van der Meijden
- - Michele Locati
- Dariusz Ruminski
- Mathieu Lechat
- Erik Trapman (eriktrapman)
@@ -588,7 +590,6 @@ Symfony is the result of the work of many people who made the code better
- Javier López (loalf)
- Reinier Kip
- Geoffrey Brier (geoffrey-brier)
- - Boris Vujicic (boris.vujicic)
- Dustin Dobervich (dustin10)
- dantleech
- Anne-Sophie Bachelard (annesophie)
@@ -603,6 +604,7 @@ Symfony is the result of the work of many people who made the code better
- mcfedr (mcfedr)
- Rostyslav Kinash
- Maciej Malarz (malarzm)
+ - Pascal Luna (skalpa)
- Daisuke Ohata
- Vincent Simonin
- Alex Bogomazov (alebo)
@@ -623,6 +625,7 @@ Symfony is the result of the work of many people who made the code better
- Denis Brumann (dbrumann)
- Quentin de Longraye (quentinus95)
- Chris Heng (gigablah)
+ - Shaun Simmons (simshaun)
- Richard Bradley
- Ulumuddin Yunus (joenoez)
- Johann Saunier (prophet777)
@@ -765,6 +768,7 @@ Symfony is the result of the work of many people who made the code better
- Maksim Kotlyar (makasim)
- Neil Ferreira
- Nathanael Noblet (gnat)
+ - Indra Gunawan (indragunawan)
- Dmitry Parnas (parnas)
- Paul LE CORRE
- Emanuele Iannone
@@ -951,6 +955,7 @@ Symfony is the result of the work of many people who made the code better
- Ken Marfilla (marfillaster)
- benatespina (benatespina)
- Denis Kop
+ - Jean-Guilhem Rouel (jean-gui)
- jfcixmedia
- Nikita Konstantinov
- Martijn Evers
@@ -982,7 +987,6 @@ Symfony is the result of the work of many people who made the code better
- Olaf Klischat
- orlovv
- Peter Smeets (darkspartan)
- - Haralan Dobrev (hkdobrev)
- Jhonny Lidfors (jhonny)
- Julien Bianchi (jubianchi)
- Robert Meijers
@@ -1001,6 +1005,7 @@ Symfony is the result of the work of many people who made the code better
- Jeremy Bush
- wizhippo
- Viacheslav Sychov
+ - Helmut Hummel (helhum)
- Matt Brunt
- Carlos Ortega Huetos
- rpg600
@@ -1025,6 +1030,7 @@ Symfony is the result of the work of many people who made the code better
- rchoquet
- gitlost
- Taras Girnyk
+ - Anthony GRASSIOT (antograssiot)
- Eduardo García Sanz (coma)
- James Gilliland
- fduch (fduch)
@@ -1054,6 +1060,7 @@ Symfony is the result of the work of many people who made the code better
- Peter Thompson (petert82)
- Felicitus
- Krzysztof Przybyszewski
+ - alexpozzi
- Paul Matthews
- Jakub Kisielewski
- Vacheslav Silyutin
@@ -1133,6 +1140,7 @@ Symfony is the result of the work of many people who made the code better
- Berat Doğan
- Guillaume LECERF
- Juanmi Rodriguez Cerón
+ - Sergey Yastrebov
- Andy Raines
- Anthony Ferrara
- Klaas Cuvelier (kcuvelier)
@@ -1226,6 +1234,7 @@ Symfony is the result of the work of many people who made the code better
- Ergie Gonzaga
- Matthew J Mucklo
- AnrDaemon
+ - Smaine Milianni (ismail1432)
- fdgdfg (psampaz)
- Stéphane Seng
- Maxwell Vandervelde
@@ -1362,7 +1371,6 @@ Symfony is the result of the work of many people who made the code better
- Christopher Parotat
- 蝦米
- Grayson Koonce (breerly)
- - Indra Gunawan (indragunawan)
- Karim Cassam Chenaï (ka)
- Michal Kurzeja (mkurzeja)
- Nicolas Bastien (nicolas_bastien)
@@ -1446,6 +1454,7 @@ Symfony is the result of the work of many people who made the code better
- Edvinas Klovas
- Drew Butler
- Peter Breuls
+ - Chansig
- Tischoi
- J Bruni
- Alexey Prilipko
@@ -1530,6 +1539,7 @@ Symfony is the result of the work of many people who made the code better
- Erik van Wingerden
- Valouleloup
- Dane Powell
+ - mweimerskirch
- Gerrit Drost
- Linnaea Von Lavia
- Simon Mönch
@@ -1633,6 +1643,7 @@ Symfony is the result of the work of many people who made the code better
- temperatur
- Cas
- Dusan Kasan
+ - Karolis
- Myke79
- Brian Debuire
- Piers Warmers
@@ -1703,7 +1714,6 @@ Symfony is the result of the work of many people who made the code better
- Neophy7e
- bokonet
- Arrilot
- - Shaun Simmons
- Markus Staab
- Pierre-Louis LAUNAY
- djama
@@ -1832,6 +1842,7 @@ Symfony is the result of the work of many people who made the code better
- emilienbouard (neime)
- Nicholas Byfleet (nickbyfleet)
- Tomas Norkūnas (norkunas)
+ - Marco Petersen (ocrampete16)
- ollie harridge (ollietb)
- Paul Andrieux (paulandrieux)
- Paweł Szczepanek (pauluz)
@@ -1851,11 +1862,11 @@ Symfony is the result of the work of many people who made the code better
- scourgen hung (scourgen)
- Sébastien Alfaiate (seb33300)
- Sebastian Busch (sebu)
+ - Christophe Villeger (seragan)
- André Filipe Gonçalves Neves (seven)
- Bruno Ziegler (sfcoder)
- Andrea Giuliano (shark)
- Schuyler Jager (sjager)
- - Pascal Luna (skalpa)
- Volker (skydiablo)
- Serkan Yildiz (srknyldz)
- Julien Sanchez (sumbobyboys)
@@ -1886,6 +1897,7 @@ Symfony is the result of the work of many people who made the code better
- Ben Scott
- Dionysis Arvanitis
- Sergey Fedotov
+ - Konstantin Scheumann
- Michael
- fh-github@fholzhauer.de
- AbdElKader Bouadjadja
diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php
index d36e6f9560159..182622a29a5c8 100644
--- a/src/Symfony/Component/Console/Output/StreamOutput.php
+++ b/src/Symfony/Component/Console/Output/StreamOutput.php
@@ -81,17 +81,26 @@ protected function doWrite($message, $newline)
*
* Colorization is disabled if not supported by the stream:
*
- * - Windows != 10.0.10586 without Ansicon, ConEmu or Mintty
+ * - the stream is redirected (eg php file.php >log)
+ * - Windows without VT100 support, Ansicon, ConEmu, Mintty
* - non tty consoles
*
* @return bool true if the stream supports colorization, false otherwise
*/
protected function hasColorSupport()
{
+ if (function_exists('stream_isatty') && !@stream_isatty($this->stream)) {
+ return false;
+ }
if (DIRECTORY_SEPARATOR === '\\') {
+ if (function_exists('sapi_windows_vt100_support')) {
+ $vt100Enabled = @sapi_windows_vt100_support($this->stream);
+ } else {
+ $vt100Enabled = '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD;
+ }
+
return
- function_exists('sapi_windows_vt100_support') && @sapi_windows_vt100_support($this->stream)
- || '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
+ $vt100Enabled
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
diff --git a/src/Symfony/Component/Debug/Debug.php b/src/Symfony/Component/Debug/Debug.php
index 1e29d45826d66..9ae3496b3eb81 100644
--- a/src/Symfony/Component/Debug/Debug.php
+++ b/src/Symfony/Component/Debug/Debug.php
@@ -45,7 +45,7 @@ public static function enable($errorReportingLevel = null, $displayErrors = true
error_reporting(-1);
}
- if (!in_array(PHP_SAPI, array('cli', 'phpdbg'))) {
+ if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true)) {
ini_set('display_errors', 0);
ExceptionHandler::register();
} elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {
diff --git a/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php
index e5e9c2be83b43..5c82435d58a06 100644
--- a/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php
+++ b/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php
@@ -154,7 +154,7 @@ public function testStopEventPropagation()
// be executed
// Manually set priority to enforce $this->listener to be called first
$this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'), 10);
- $this->dispatcher->addListener('post.foo', array($otherListener, 'preFoo'));
+ $this->dispatcher->addListener('post.foo', array($otherListener, 'postFoo'));
$this->dispatcher->dispatch(self::postFoo);
$this->assertTrue($this->listener->postFooInvoked);
$this->assertFalse($otherListener->postFooInvoked);
diff --git a/src/Symfony/Component/Finder/Finder.php b/src/Symfony/Component/Finder/Finder.php
index 8eb75fca62a42..8ebba9b9c650c 100644
--- a/src/Symfony/Component/Finder/Finder.php
+++ b/src/Symfony/Component/Finder/Finder.php
@@ -629,9 +629,9 @@ public function in($dirs)
foreach ((array) $dirs as $dir) {
if (is_dir($dir)) {
- $resolvedDirs[] = $dir;
+ $resolvedDirs[] = $this->normalizeDir($dir);
} elseif ($glob = glob($dir, (defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
- $resolvedDirs = array_merge($resolvedDirs, $glob);
+ $resolvedDirs = array_merge($resolvedDirs, array_map(array($this, 'normalizeDir'), $glob));
} else {
throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
}
@@ -794,4 +794,16 @@ private function resetAdapterSelection()
return $properties;
}, $this->adapters);
}
+
+ /**
+ * Normalizes given directory names by removing trailing slashes.
+ *
+ * @param string $dir
+ *
+ * @return string
+ */
+ private function normalizeDir($dir)
+ {
+ return rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
+ }
}
diff --git a/src/Symfony/Component/Finder/SplFileInfo.php b/src/Symfony/Component/Finder/SplFileInfo.php
index 2cf3a27fa9f6b..19f95e26be69a 100644
--- a/src/Symfony/Component/Finder/SplFileInfo.php
+++ b/src/Symfony/Component/Finder/SplFileInfo.php
@@ -28,7 +28,7 @@ class SplFileInfo extends \SplFileInfo
*/
public function __construct($file, $relativePath, $relativePathname)
{
- parent::__construct(realpath($file) ?: $file);
+ parent::__construct($file);
$this->relativePath = $relativePath;
$this->relativePathname = $relativePathname;
}
diff --git a/src/Symfony/Component/Finder/Tests/BsdFinderTest.php b/src/Symfony/Component/Finder/Tests/BsdFinderTest.php
index 42691a4318531..101175253a7ca 100644
--- a/src/Symfony/Component/Finder/Tests/BsdFinderTest.php
+++ b/src/Symfony/Component/Finder/Tests/BsdFinderTest.php
@@ -15,6 +15,16 @@
class BsdFinderTest extends FinderTest
{
+ public function testSymlinksNotResolved()
+ {
+ $this->markTestSkipped('Symlinks are always resolved using the BsdFinderAdapter.');
+ }
+
+ public function testBackPathNotNormalized()
+ {
+ $this->markTestSkipped('Paths are always normalized using the BsdFinderAdapter.');
+ }
+
protected function getAdapter()
{
$adapter = new BsdFindAdapter();
diff --git a/src/Symfony/Component/Finder/Tests/FinderTest.php b/src/Symfony/Component/Finder/Tests/FinderTest.php
index dd90c4e844b86..b240728c96810 100644
--- a/src/Symfony/Component/Finder/Tests/FinderTest.php
+++ b/src/Symfony/Component/Finder/Tests/FinderTest.php
@@ -50,15 +50,40 @@ public function testFiles()
public function testRemoveTrailingSlash()
{
- if ('\\' === \DIRECTORY_SEPARATOR) {
- $this->markTestSkipped('This test cannot be run on Windows.');
+ $finder = $this->buildFinder();
+
+ $expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar'));
+ $in = self::$tmpDir.'//';
+
+ $this->assertIterator($expected, $finder->in($in)->files()->getIterator());
+ }
+
+ public function testSymlinksNotResolved()
+ {
+ if ('\\' === DIRECTORY_SEPARATOR) {
+ $this->markTestSkipped('symlinks are not supported on Windows');
}
$finder = $this->buildFinder();
- $expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar'));
- $in = '//'.realpath(self::$tmpDir).'//';
+ symlink($this->toAbsolute('foo'), $this->toAbsolute('baz'));
+ $expected = $this->toAbsolute(array('baz/bar.tmp'));
+ $in = self::$tmpDir.'/baz/';
+ try {
+ $this->assertIterator($expected, $finder->in($in)->files()->getIterator());
+ unlink($this->toAbsolute('baz'));
+ } catch (\Exception $e) {
+ unlink($this->toAbsolute('baz'));
+ throw $e;
+ }
+ }
+
+ public function testBackPathNotNormalized()
+ {
+ $finder = $this->buildFinder();
+ $expected = $this->toAbsolute(array('foo/../foo/bar.tmp'));
+ $in = self::$tmpDir.'/foo/../foo/';
$this->assertIterator($expected, $finder->in($in)->files()->getIterator());
}
@@ -279,7 +304,7 @@ public function testInWithNonExistentDirectory()
public function testInWithGlob()
{
$finder = $this->buildFinder();
- $finder->in(array(__DIR__.'/Fixtures/*/B/C', __DIR__.'/Fixtures/*/*/B/C'))->getIterator();
+ $finder->in(array(__DIR__.'/Fixtures/*/B/C/', __DIR__.'/Fixtures/*/*/B/C/'))->getIterator();
$this->assertIterator($this->toAbsoluteFixtures(array('A/B/C/abc.dat', 'copy/A/B/C/abc.dat.copy')), $finder);
}
@@ -518,8 +543,8 @@ public function testMultipleLocationsWithSubDirectories()
$finder->in($locations)->depth('< 10')->name('*.neon');
$expected = array(
- __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon',
- __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon',
+ __DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'c.neon',
+ __DIR__.'/Fixtures/one'.DIRECTORY_SEPARATOR.'b'.DIRECTORY_SEPARATOR.'d.neon',
);
$this->assertIterator($expected, $finder);
diff --git a/src/Symfony/Component/Finder/Tests/GnuFinderTest.php b/src/Symfony/Component/Finder/Tests/GnuFinderTest.php
index 5c66723c1bea1..48286d5a2d36a 100644
--- a/src/Symfony/Component/Finder/Tests/GnuFinderTest.php
+++ b/src/Symfony/Component/Finder/Tests/GnuFinderTest.php
@@ -15,6 +15,16 @@
class GnuFinderTest extends FinderTest
{
+ public function testSymlinksNotResolved()
+ {
+ $this->markTestSkipped('Symlinks are always resolved using the GnuFinderAdapter.');
+ }
+
+ public function testBackPathNotNormalized()
+ {
+ $this->markTestSkipped('Paths are always normalized using the GnuFinderAdapter.');
+ }
+
protected function getAdapter()
{
$adapter = new GnuFindAdapter();
diff --git a/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php
index 3c805086afec2..fdf810bebd3db 100644
--- a/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php
+++ b/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php
@@ -31,7 +31,7 @@ public function testSubPath($baseDir, array $paths, array $subPaths, array $subP
public function getSubPathData()
{
- $tmpDir = sys_get_temp_dir().DIRECTORY_SEPARATOR.'symfony_finder';
+ $tmpDir = sys_get_temp_dir().'/symfony_finder';
return array(
array(
diff --git a/src/Symfony/Component/Form/Resources/translations/validators.da.xlf b/src/Symfony/Component/Form/Resources/translations/validators.da.xlf
index c2dd4601f9089..f52f4e0a30db9 100644
--- a/src/Symfony/Component/Form/Resources/translations/validators.da.xlf
+++ b/src/Symfony/Component/Form/Resources/translations/validators.da.xlf
@@ -8,11 +8,11 @@
The uploaded file was too large. Please try to upload a smaller file.
- Den oploadede fil var for stor. Opload venligst en mindre fil.
+ Den uploadede fil var for stor. Upload venligst en mindre fil.The CSRF token is invalid. Please try to resubmit the form.
- CSRF nøglen er ugyldig.
+ CSRF-token er ugyldig.