Skip to content

Commit 434934c

Browse files
committed
Merge branch '2.8' into 3.0
* 2.8: fixed undefined variable Fixed the phpDoc of UserInterface fixed APCu dep version make apc class loader testable against apcu without apc bc layer Added support for the `0.0.0.0/0` trusted proxy fixed CS [DoctrineBridge][Validator] >= 2.3 Pass association instead of ID as argument Limit the max height/width of icons in the profiler menu added missing constant Added 451 status code Remove unnecessary code Allow absolute URLs to be displayed in the debug toolbar [ClassLoader] Use symfony/polyfill-apcu update upgrade files with CSRF related option info [TranslationUpdateCommand] fixed undefined resultMessage var. [HttpKernel] Lookup the response even if the lock was released after 2 seconds
2 parents eddf359 + 3c542e0 commit 434934c

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

Command/TranslationUpdateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
150150
return;
151151
}
152152

153+
$resultMessage = 'Translation files were successfully updated';
154+
153155
// show compiled list of messages
154156
if (true === $input->getOption('dump-messages')) {
155157
$extractedMessagesCount = 0;
@@ -204,12 +206,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
204206
$writer->writeTranslations($operation->getResult(), $input->getOption('output-format'), array('path' => $bundleTransPath, 'default_locale' => $this->getContainer()->getParameter('kernel.default_locale')));
205207

206208
if (true === $input->getOption('dump-messages')) {
207-
$resultMessage .= ' and translation files were updated.';
208-
} else {
209-
$resultMessage = 'Translation files were successfully updated.';
209+
$resultMessage .= ' and translation files were updated';
210210
}
211211
}
212212

213-
$io->success($resultMessage);
213+
$io->success($resultMessage.'.');
214214
}
215215
}

DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ public function getConfigTreeBuilder()
7070
}
7171

7272
if (false !== strpos($v, '/')) {
73+
if ('0.0.0.0/0' === $v) {
74+
return false;
75+
}
76+
7377
list($v, $mask) = explode('/', $v, 2);
7478

7579
if (strcmp($mask, (int) $mask) || $mask < 1 || $mask > (false !== strpos($v, ':') ? 128 : 32)) {

Tests/Command/TranslationUpdateCommandTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public function testDumpMessagesAndClean()
2828
$tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo')));
2929
$tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--dump-messages' => true, '--clean' => true));
3030
$this->assertRegExp('/foo/', $tester->getDisplay());
31+
$this->assertRegExp('/2 messages were successfully extracted/', $tester->getDisplay());
32+
}
33+
34+
public function testWriteMessages()
35+
{
36+
$tester = $this->createCommandTester($this->getContainer(array('foo' => 'foo')));
37+
$tester->execute(array('command' => 'translation:update', 'locale' => 'en', 'bundle' => 'foo', '--force' => true));
38+
$this->assertRegExp('/Translation files were successfully updated./', $tester->getDisplay());
3139
}
3240

3341
protected function setUp()

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function getTestValidTrustedProxiesData()
6666
array(array(), array()),
6767
array(array('10.0.0.0/8'), array('10.0.0.0/8')),
6868
array(array('::ffff:0:0/96'), array('::ffff:0:0/96')),
69+
array(array('0.0.0.0/0'), array('0.0.0.0/0')),
6970
);
7071
}
7172

0 commit comments

Comments
 (0)