8000 Merge branch '2.4' into 2.5 · symfony/symfony@e74d37b · GitHub
[go: up one dir, main page]

Skip to content

Commit e74d37b

Browse files
committed
Merge branch '2.4' into 2.5
* 2.4: Minor doc fix. Simplified the way to update PHPUnit to the latest version [Process] Minor README update [HttpFoundation] Basic auth in url is broken when using PHP CGI/FPM Fixed a html error "Element ul is not closed" in logger.html.twig [HttpFoundation] Officialize the 308 redirect RFC Officialize the 308 redirect RFC issue #10808 crawler test Empty select with attribute name="foo[]" bug fix Fixed contextually wrong translation
2 parents 64ca6c3 + ec1065a commit e74d37b

File tree

10 files changed

+31
-21
lines changed

10 files changed

+31
-21
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ before_script:
2424
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
2525
- sudo locale-gen fr_FR.UTF-8 && sudo update-locale
2626
- COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev install
27-
- wget https://phar.phpunit.de/phpunit.phar && rm `which phpunit` && sudo cp phpunit.phar /usr/local/bin/phpunit && sudo chmod +x /usr/local/bin/phpunit
27+
- phpunit --self-update
2828

2929
script:
3030
- ls -d src/Symfony/*/* | parallel --gnu --keep-order 'echo "Running {} tests"; phpunit --exclude-group tty,benchmark {};' || false

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@
128128

129129
<li>Called from {{ call.file is defined and call.line is defined ? call.file|format_file(call.line, from) : from|raw }}</li>
130130

131-
{{ index == log.context.stack|length - 1 ? '</ul>' : '' }}
131+
{% if index == log.context.stack|length - 1 %}
132+
</ul>
133+
{% endif %}
132134
{% endfor %}
133135
{% else %}
134136
{{ log.priorityName }} - {{ log.message }}

src/Symfony/Component/DomCrawler/Form.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ public function getPhpValues()
146146
$values = array();
147147
foreach ($this->getValues() as $name => $value) {
148148
$qs = http_build_query(array($name => $value), '', '&');
149-
parse_str($qs, $expandedValue);
150-
$varName = substr($name, 0, strlen(key($expandedValue)));
151-
$values = array_replace_recursive($values, array($varName => current($expandedValue)));
149+
if (!empty($qs)) {
150+
parse_str($qs, $expandedValue);
151+
$varName = substr($name, 0, strlen(key($expandedValue)));
152+
$values = array_replace_recursive($values, array($varName => current($expandedValue)));
153+
}
152154
}
153155

154156
return $values;
@@ -169,9 +171,11 @@ public function getPhpFiles()
169171
$values = array();
170172
foreach ($this->getFiles() as $name => $value) {
171173
$qs = http_build_query(array($name => $value), '', '&');
172-
parse_str($qs, $expandedValue);
173-
$varName = substr($name, 0, strlen(key($expandedValue)));
174-
$values = array_replace_recursive($values, array($varName => current($expandedValue)));
174+
if (!empty($qs)) {
175+
parse_str($qs, $expandedValue);
176+
$varName = substr($name, 0, strlen(key($expandedValue)));
177+
$values = array_replace_recursive($values, array($varName => current($expandedValue)));
178+
}
175179
}
176180

177181
return $values;

src/Symfony/Component/DomCrawler/Tests/FormTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ public function testOffsetExists()
394394

395395
public function testGetValues()
396396
{
397-
$form = $this->createForm('<form><input type="text" name="foo[bar]" value="foo" /><input type="text" name="bar" value="bar" /><input type="submit" /></form>');
398-
$this->assertEquals(array('foo[bar]' => 'foo', 'bar' => 'bar'), $form->getValues(), '->getValues() returns all form field values');
397+
$form = $this->createForm('<form><input type="text" name="foo[bar]" value="foo" /><input type="text" name="bar" value="bar" /><select multiple="multiple" name="baz[]"></select><input type="submit" /></form>');
398+
$this->assertEquals(array('foo[bar]' => 'foo', 'bar' => 'bar', 'baz' => array()), $form->getValues(), '->getValues() returns all form field values');
399399

400400
$form = $this->createForm('<form><input type="checkbox" name="foo" value="foo" /><input type="text" name="bar" value="bar" /><input type="submit" /></form>');
401401
$this->assertEquals(array('bar' => 'bar'), $form->getValues(), '->getValues() does not include not-checked checkboxes');
@@ -431,6 +431,10 @@ public function testGetPhpValues()
431431

432432
$form = $this->createForm('<form><input type="text" name="fo.o[ba.r][]" value="foo" /><input type="text" name="fo.o[ba.r][ba.z]" value="bar" /><input type="submit" /></form>');
433433
$this->assertEquals(array('fo.o' => array('ba.r' => array('foo', 'ba.z' => 'bar'))), $form->getPhpValues(), '->getPhpValues() preserves periods and spaces in names recursively');
434+
435+
$form = $this->createForm('<form><input type="text" name="foo[bar]" value="foo" /><input type="text" name="bar" value="bar" /><select multiple="multiple" name="baz[]"></select><input type="submit" /></form>');
436+
$this->assertEquals(array('foo' => array('bar' => 'foo'), 'bar' => 'bar'), $form->getPhpValues(), "->getPhpValues() doesn't return empty values");
437+
434438
}
435439

436440
public function testGetFiles()

src/Symfony/Component/Form/FormTypeInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface FormTypeInterface
2121
/**
2222
* Builds the form.
2323
*
24-
* This method is called for each type in the hierarchy starting form the
24+
* This method is called for each type in the hierarchy starting from the
2525
* top most type. Type extensions can further modify the form.
2626
*
2727
* @see FormTypeExtensionInterface::buildForm()
@@ -34,7 +34,7 @@ public function buildForm(FormBuilderInterface $builder, array $options);
3434
/**
3535
* Builds the form view.
3636
*
37-
* This method is called for each type in the hierarchy starting form the
37+
* This method is called for each type in the hierarchy starting from the
3838
* top most type. Type extensions can further modify the view.
3939
*
4040
* A view of a form is built before the views of the child forms are built.
@@ -52,7 +52,7 @@ public function buildView(FormView $view, FormInterface $form, array $options);
5252
/**
5353
* Finishes the form view.
5454
*
55-
* This method gets called for each type in the hierarchy starting form the
55+
* This method gets called for each type in the hierarchy starting from the
5656
* top most type. Type extensions can further modify the view.
5757
*
5858
* When this method is called, views of the form's children have already

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ public function getPort()
972972
*/
973973
public function getUser()
974974
{
975-
return $this->server->get('PHP_AUTH_USER');
975+
return $this->headers->get('PHP_AUTH_USER');
976976
}
977977

978978
/**
@@ -982,7 +982,7 @@ public function getUser()
982982
*/
983983
public function getPassword()
984984
{
985-
return $this->server->get('PHP_AUTH_PW');
985+
return $this->headers->get('PHP_AUTH_PW');
986986
}
987987

988988
/**

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Response
4141
const HTTP_USE_PROXY = 305;
4242
const HTTP_RESERVED = 306;
4343
const HTTP_TEMPORARY_REDIRECT = 307;
44-
const HTTP_PERMANENTLY_REDIRECT = 308; // RFC-reschke-http-status-308-07
44+
const HTTP_PERMANENTLY_REDIRECT = 308; // RFC7238
4545
const HTTP_BAD_REQUEST = 400;
4646
const HTTP_UNAUTHORIZED = 401;
4747
const HTTP_PAYMENT_REQUIRED = 402;
@@ -144,7 +144,7 @@ class Response
144144
305 => 'Use Proxy',
145145
306 => 'Reserved',
146146
307 => 'Temporary Redirect',
147-
308 => 'Permanent Redirect', // RFC-reschke-http-status-308-07
147+
308 => 'Permanent Redirect', // RFC7238
148148
400 => 'Bad Request',
149149
401 => 'Unauthorized',
150150
402 => 'Payment Required',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function testCreate()
209209
$this->assertEquals(80, $request->getPort());
210210
$this->assertEquals('test.com', $request->getHttpHost());
211211
$this->assertEquals('testnopass', $request->getUser());
212-
$this->assertNull($request->getPassword());
212+
$this->assertSame('',$request->getPassword());
213213
$this->assertFalse($request->isSecure());
214214

215215
$request = Request::create('http://test.com/?foo');

src/Symfony/Component/Process/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ as it becomes available:
2727

2828
$process = new Process('ls -lsa');
2929
$process->run(function ($type, $buffer) {
30-
if ('err' === $type) {
30+
if (Process::ERR === $type) {
3131
echo 'ERR > '.$buffer;
3232
} else {
3333
echo 'OUT > '.$buffer;
@@ -42,6 +42,6 @@ Resources
4242

4343
You can run the unit tests with the following command:
4444

45-
$ cd path/to/Symfony/Component/XXX/
45+
$ cd path/to/Symfony/Component/Process/
4646
$ composer.phar install
4747
$ phpunit

src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
</trans-unit>
8989
<trans-unit id="22">
9090
<source>This value should not be blank.</source>
91-
<target>Bu değer boşluk olamaz.</target>
91+
<target>Bu değer boş bırakılmamalıdır.</target>
9292
</trans-unit>
9393
<trans-unit id="23">
9494
<source>This value should not be null.</source>

0 commit comments

Comments
 (0)
0