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 fe6e9e4

Browse filesBrowse files
Merge branch '2.7' into 2.8
* 2.7: Sent out a status text for unknown HTTP headers. [DependencyInjection] Unescape parameters for all types of injection
2 parents 02c31ad + c91638f commit fe6e9e4
Copy full SHA for fe6e9e4

File tree

4 files changed

+22
-4
lines changed
Filter options

4 files changed

+22
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ public function createService(Definition $definition, $id, $tryProxy = true)
936936
$this->callMethod($service, $call);
937937
}
938938

939-
$properties = $this->resolveServices($parameterBag->resolveValue($definition->getProperties()));
939+
$properties = $this->resolveServices($parameterBag->unescapeValue($parameterBag->resolveValue($definition->getProperties())));
940940
foreach ($properties as $name => $value) {
941941
$service->$name = $value;
942942
}
@@ -1134,7 +1134,7 @@ private function callMethod($service, $call)
11341134
}
11351135
}
11361136

1137-
call_user_func_array(array($service, $call[0]), $this->resolveServices($this->getParameterBag()->resolveValue($call[1])));
1137+
call_user_func_array(array($service, $call[0]), $this->resolveServices($this->getParameterBag()->unescapeValue($this->getParameterBag()->resolveValue($call[1]))));
11381138
}
11391139

11401140
/**

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,24 @@ public function testCreateServiceMethodCalls()
355355
$this->assertEquals(array('bar', $builder->get('bar')), $builder->get('foo1')->bar, '->createService() replaces the values in the method calls arguments');
356356
}
357357

358+
public function testCreateServiceMethodCallsWithEscapedParam()
359+
{
360+
$builder = new ContainerBuilder();
361+
$builder->register('bar', 'stdClass');
362+
$builder->register('foo1', 'FooClass')->addMethodCall('setBar', array(array('%%unescape_it%%')));
363+
$builder->setParameter('value', 'bar');
364+
$this->assertEquals(array('%unescape_it%'), $builder->get('foo1')->bar, '->createService() replaces the values in the method calls arguments');
365+
}
366+
367+
public function testCreateServiceProperties()
368+
{
369+
$builder = new ContainerBuilder();
370+
$builder->register('bar', 'stdClass');
371+
$builder->register('foo1', 'FooClass')->setProperty('bar', array('%value%', new Reference('bar'), '%%unescape_it%%'));
372+
$builder->setParameter('value', 'bar');
373+
$this->assertEquals(array('bar', $builder->get('bar'), '%unescape_it%'), $builder->get('foo1')->bar, '->createService() replaces the values in the properties');
374+
}
375+
358376
public function testCreateServiceConfigurator()
359377
{
360378
$builder = new ContainerBuilder();

‎src/Symfony/Component/HttpFoundation/Response.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Response.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public function setStatusCode($code, $text = null)
455455
}
456456

457457
if (null === $text) {
458-
$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : '';
458+
$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : 'unknown status';
459459

460460
return $this;
461461
}

‎src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ public function getStatusCodeFixtures()
695695
array('200', null, 'OK'),
696696
array('200', false, ''),
697697
array('200', 'foo', 'foo'),
698-
array('199', null, ''),
698+
array('199', null, 'unknown status'),
699699
array('199', false, ''),
700700
array('199', 'foo', 'foo'),
701701
);

0 commit comments

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