Skip to content

Commit 0bd01ca

Browse files
Merge branch '4.3' into 4.4
* 4.3: [OptionsResolve] Revert change in tests for a not-merged change in code [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected [Workflow] Made the configuration more robust for the 'property' key [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible #30432 fix an error message fix paths to detect code owners [HttpClient] ignore the body of responses to HEAD requests [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 [SecurityBundle] Fix wrong assertion Remove unused local variables in tests [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method Make sure to collect child forms created on *_SET_DATA events [WebProfilerBundle] Improve display in Email panel for dark theme do not render errors for checkboxes twice
2 parents a02c413 + 18ea38b commit 0bd01ca

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Constraints/FileValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function validate($value, Constraint $constraint)
6161
$binaryFormat = null === $constraint->binaryFormat ? true : $constraint->binaryFormat;
6262
}
6363

64-
list($sizeAsString, $limitAsString, $suffix) = $this->factorizeSizes(0, $limitInBytes, $binaryFormat);
64+
list(, $limitAsString, $suffix) = $this->factorizeSizes(0, $limitInBytes, $binaryFormat);
6565
$this->context->buildViolation($constraint->uploadIniSizeErrorMessage)
6666
->setParameter('{{ limit }}', $limitAsString)
6767
->setParameter('{{ suffix }}', $suffix)

Tests/Constraints/FileValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public function uploadedFileErrorProvider()
456456
$reflection = new \ReflectionClass(\get_class(new FileValidator()));
457457
$method = $reflection->getMethod('factorizeSizes');
458458
$method->setAccessible(true);
459-
list($sizeAsString, $limit, $suffix) = $method->invokeArgs(new FileValidator(), [0, UploadedFile::getMaxFilesize(), false]);
459+
list(, $limit, $suffix) = $method->invokeArgs(new FileValidator(), [0, UploadedFile::getMaxFilesize(), false]);
460460

461461
// it correctly parses the maxSize option and not only uses simple string comparison
462462
// 1000M should be bigger than the ini value

Tests/Util/PropertyPathTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function provideAppendPaths()
3232
['foo', 'bar', 'foo.bar', 'It append the subPath to the basePath'],
3333
['foo', '[bar]', 'foo[bar]', 'It does not include the dot separator if subPath uses the array notation'],
3434
['0', 'bar', '0.bar', 'Leading zeros are kept.'],
35+
['0', 1, '0.1', 'Numeric subpaths do not cause PHP 7.4 errors.'],
3536
];
3637
}
3738
}

Util/PropertyPath.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ class PropertyPath
3636
*/
3737
public static function append($basePath, $subPath)
3838
{
39-
if ('' !== (string) $subPath) {
39+
$subPath = (string) $subPath;
40+
if ('' !== $subPath) {
4041
if ('[' === $subPath[0]) {
4142
return $basePath.$subPath;
4243
}
4344

44-
return '' !== (string) $basePath ? $basePath.'.'.$subPath : $subPath;
45+
return '' !== $basePath ? $basePath.'.'.$subPath : $subPath;
4546
}
4647

4748
return $basePath;

0 commit comments

Comments
 (0)