Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 74c4974

Browse filesBrowse files
Merge branch '2.8' into 3.0
* 2.8: [VarDumper] Fix tests on PHP 7 [DomCrawler] Clarify the value returned by getPhpFiles() [DependencyInjection] Fix #16461 Let Container::set() replace existing aliases avoid (string) catchable fatal error for instances of __PHP_Incomplete_Class remove unnecessary retrieval and setting of data Update validators.fr.xlf avoid (string) catchable fatal error for __PHP_Incomplete_Class instances sendContent return as parent. [DomCrawler] Remove the overridden getHash() method to prevent problems when cloning the crawler [FrameworkBundle] Fix a typo Added more exceptions to singularify method Add width attribute on SVG [FrameworkBundle] Support autowiring for TranslationInterface [WebProfiler] Fixed styles for search block and menu profiler for IE Edge Conflicts: src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php src/Symfony/Component/DomCrawler/Crawler.php
2 parents 45031ff + 1d8d43b commit 74c4974
Copy full SHA for 74c4974

File tree

Expand file treeCollapse file tree

36 files changed

+110
-49
lines changed
Filter options
Expand file treeCollapse file tree

36 files changed

+110
-49
lines changed
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ protected function configure()
4747
))
4848
->setDescription('Updates the translation file')
4949
->setHelp(<<<'EOF'
50-
The <info>%command.name%</info> command extract translation strings from templates
50+
The <info>%command.name%</info> command extracts translation strings from templates
5151
of a given bundle or the app folder. It can display them or merge the new ones into the translation files.
52+
5253
When new translation strings are found it can automatically add a prefix to the translation
5354
message.
5455

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/translation.xml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
<call method="setConfigCacheFactory">
1818
<argument type="service" id="config_cache_factory" />
1919
</call>
20+
21+
<autowiring-type>Symfony\Component\Translation\TranslatorInterface</autowiring-type>
2022
</service>
2123

2224
<service id="translator.logging" class="Symfony\Component\Translation\LoggingTranslator" public="false">
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/ajax.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/close.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/event.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/event.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/exception.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/exception.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/form.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/logger.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/memory.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/no.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/no.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/request.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/request.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/router.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/router.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/search.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/search.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/symfony.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/time.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/translation.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/twig.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/yes.svg

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/yes.svg
+1-1Lines changed: 1 addition & 1 deletion
Loading

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ tr.status-warning td {
588588
#menu-profiler {
589589
margin: 0;
590590
padding: 0;
591+
list-style-type: none;
591592
}
592593
#menu-profiler li {
593594
position: relative;

‎src/Symfony/Component/DependencyInjection/Container.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Container.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ public function set($id, $service)
169169
throw new InvalidArgumentException('You cannot set service "service_container".');
170170
}
171171

172+
if (isset($this->aliases[$id])) {
173+
unset($this->aliases[$id]);
174+
}
175+
172176
$this->services[$id] = $service;
173177

174178
if (null === $service) {

‎src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,16 @@ public function testAddAliases()
231231
$this->assertTrue(isset($aliases['foobar']));
232232
}
233233

234+
public function testSetReplacesAlias()
235+
{
236+
$builder = new ContainerBuilder();
237+
$builder->setAlias('alias', 'aliased');
238+
$builder->set('aliased', new \stdClass());
239+
240+
$builder->set('alias', $foo = new \stdClass());
241+
$this->assertSame($foo, $builder->get('alias'), '->set() replaces an existing alias');
242+
}
243+
234244
public function testAddGetCompilerPass()
235245
{
236246
$builder = new ContainerBuilder();

‎src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ public function testSetWithNullResetTheService()
142142
$this->assertFalse($sc->has('foo'), '->set() with null service resets the service');
143143
}
144144

145+
public function testSetReplacesAlias()
146+
{
147+
$c = new ProjectServiceContainer();
148+
149+
$c->set('alias', $foo = new \stdClass());
150+
$this->assertSame($foo, $c->get('alias'), '->set() replaces an existing alias');
151+
}
152+
145153
public function testGet()
146154
{
147155
$sc = new ProjectServiceContainer();

‎src/Symfony/Component/DomCrawler/Form.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Form.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@ public function getPhpValues()
157157
*
158158
* This method converts fields with the array notation
159159
* (like foo[bar] to arrays) like PHP does.
160+
* The returned array is consistent with the array for field values
161+
* (@see getPhpValues), rather than uploaded files found in $_FILES.
162+
* For a compound file field foo[bar] it will create foo[bar][name],
163+
* instead of foo[name][bar] which would be found in $_FILES.
160164
*
161-
* @return array An array of field values.
165+
* @return array An array of file field values.
162166
*/
163167
public function getPhpFiles()
164168
{

‎src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ public function __construct($fieldName, CsrfTokenManagerInterface $tokenManager,
8585
public function preSubmit(FormEvent $event)
8686
{
8787
$form = $event->getForm();
88-
$data = $event->getData();
8988

9089
if ($form->isRoot() && $form->getConfig()->getOption('compound')) {
90+
$data = $event->getData();
91+
9192
if (!isset($data[$this->fieldName]) || !$this->tokenManager->isTokenValid(new CsrfToken($this->tokenId, $data[$this->fieldName]))) {
9293
$errorMessage = $this->errorMessage;
9394

@@ -100,9 +101,8 @@ public function preSubmit(FormEvent $event)
100101

101102
if (is_array($data)) {
102103
unset($data[$this->fieldName]);
104+
$event->setData($data);
103105
}
104106
}
105-
106-
$event->setData($data);
107107
}
108108
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.