Skip to content

Commit 32fd8e0

Browse files
committed
Merge branch '4.2' into 4.3
* 4.2: [FrameworkBundle] Fix calling Client::getProfile() before sending a request Fix type error [Security/Core] Don't use ParagonIE_Sodium_Compat collect called listeners information only once add test to avoid regressions fix typos Turkish translation added to Form Component
2 parents 7f9dad1 + f0acaff commit 32fd8e0

File tree

8 files changed

+57
-11
lines changed

8 files changed

+57
-11
lines changed

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ private function sanitizeQuery($connectionName, $query)
138138
if (!\is_array($query['params'])) {
139139
$query['params'] = [$query['params']];
140140
}
141+
if (!\is_array($query['types'])) {
142+
$query['types'] = [];
143+
}
141144
foreach ($query['params'] as $j => $param) {
142145
if (isset($query['types'][$j])) {
143146
// Transform the param according to the type

src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ public function testCollectQueryWithNoParams()
102102
$this->assertTrue($collectedQueries['default'][1]['explainable']);
103103
}
104104

105+
public function testCollectQueryWithNoTypes()
106+
{
107+
$queries = [
108+
['sql' => 'SET sql_mode=(SELECT REPLACE(@@sql_mode, \'ONLY_FULL_GROUP_BY\', \'\'))', 'params' => [], 'types' => null, 'executionMS' => 1],
109+
];
110+
$c = $this->createCollector($queries);
111+
$c->collect(new Request(), new Response());
112+
113+
$collectedQueries = $c->getQueries();
114+
$this->assertSame([], $collectedQueries['default'][0]['types']);
115+
}
116+
105117
public function testReset()
106118
{
107119
$queries = [

src/Symfony/Bundle/FrameworkBundle/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getKernel()
6666
*/
6767
public function getProfile()
6868
{
69-
if (!$this->kernel->getContainer()->has('profiler')) {
69+
if (null === $this->response || !$this->kernel->getContainer()->has('profiler')) {
7070
return false;
7171
}
7272

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public function testProfilerIsDisabled($insulate)
2828

2929
// enable the profiler for the next request
3030
$client->enableProfiler();
31-
$crawler = $client->request('GET', '/profiler');
32-
$profile = $client->getProfile();
33-
$this->assertInternalType('object', $profile);
31+
$this->assertFalse($client->getProfile());
32+
$client->request('GET', '/profiler');
33+
$this->assertInternalType('object', $client->getProfile());
3434

3535
$client->request('GET', '/profiler');
3636
$this->assertFalse($client->getProfile());

src/Symfony/Component/Dotenv/Tests/DotenvTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function testLoadDirectory()
314314
$dotenv->load(__DIR__);
315315
}
316316

317-
public function testServerSuperglobalIsNotOverriden()
317+
public function testServerSuperglobalIsNotOverridden()
318318
{
319319
$originalValue = $_SERVER['argc'];
320320

@@ -324,7 +324,7 @@ public function testServerSuperglobalIsNotOverriden()
324324
$this->assertSame($originalValue, $_SERVER['argc']);
325325
}
326326

327-
public function testEnvVarIsNotOverriden()
327+
public function testEnvVarIsNotOverridden()
328328
{
329329
putenv('TEST_ENV_VAR=original_value');
330330
$_SERVER['TEST_ENV_VAR'] = 'original_value';
@@ -335,7 +335,7 @@ public function testEnvVarIsNotOverriden()
335335
$this->assertSame('original_value', getenv('TEST_ENV_VAR'));
336336
}
337337

338-
public function testHttpVarIsPartiallyOverriden()
338+
public function testHttpVarIsPartiallyOverridden()
339339
{
340340
$_SERVER['HTTP_TEST_ENV_VAR'] = 'http_value';
341341

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,22 @@ public function testMirrorAvoidCopyingTargetDirectoryIfInSourceDirectory()
13621362
$this->assertFalse($this->filesystem->exists($targetPath.'target'));
13631363
}
13641364

1365+
public function testMirrorFromSubdirectoryInToParentDirectory()
1366+
{
1367+
$targetPath = $this->workspace.\DIRECTORY_SEPARATOR.'foo'.\DIRECTORY_SEPARATOR;
1368+
$sourcePath = $targetPath.'bar'.\DIRECTORY_SEPARATOR;
1369+
$file1 = $sourcePath.'file1';
1370+
$file2 = $sourcePath.'file2';
1371+
1372+
$this->filesystem->mkdir($sourcePath);
1373+
file_put_contents($file1, 'FILE1');
1374+
file_put_contents($file2, 'FILE2');
1375+
1376+
$this->filesystem->mirror($sourcePath, $targetPath);
1377+
1378+
$this->assertFileEquals($file1, $targetPath.'file1');
1379+
}
1380+
13651381
/**
13661382
* @dataProvider providePathsForIsAbsolutePath
13671383
*/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file source-language="en" datatype="plaintext" original="file.ext">
4+
<body>
5+
<trans-unit id="28">
6+
<source>This form should not contain extra fields.</source>
7+
<target>Form ekstra alanlar içeremez.</target>
8+
</trans-unit>
9+
<trans-unit id="29">
10+
<source>The uploaded file was too large. Please try to upload a smaller file.</source>
11+
<target>Yüklenen dosya boyutu çok yüksek. Lütfen daha küçük bir dosya yüklemeyi deneyin.</target>
12+
</trans-unit>
13+
<trans-unit id="30">
14+
<source>The CSRF token is invalid. Please try to resubmit the form.</source>
15+
<target>CSRF fişi geçersiz. Formu tekrar göndermeyi deneyin.</target>
16+
</trans-unit>
17+
</body>
18+
</file>
19+
</xliff>

src/Symfony/Component/Security/Core/Encoder/Argon2iPasswordEncoder.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ public static function isSupported()
5151
return true;
5252
}
5353

54-
if (class_exists('ParagonIE_Sodium_Compat') && method_exists('ParagonIE_Sodium_Compat', 'crypto_pwhash_is_available')) {
55-
return \ParagonIE_Sodium_Compat::crypto_pwhash_is_available();
56-
}
57-
5854
return \function_exists('sodium_crypto_pwhash_str') || \extension_loaded('libsodium');
5955
}
6056

0 commit comments

Comments
 (0)