Skip to content

Commit 40f8423

Browse files
Merge branch '4.2'
* 4.2: Fix Cache error while using anonymous class [Cache] fix LockRegistry Update validators.cs.xlf Make translations consistent with other translations. Correct language code for ukrainian language in security translations. Fix return type of Request::getRequestFormat [Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
2 parents cf7ac8b + 984bb0b commit 40f8423

File tree

4 files changed

+49
-20
lines changed

4 files changed

+49
-20
lines changed

Mapping/Cache/Psr6Cache.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ public function write(ClassMetadata $metadata)
6666
*/
6767
private function escapeClassName(string $class): string
6868
{
69+
if (false !== strpos($class, '@')) {
70+
// anonymous class: replace all PSR6-reserved characters
71+
return str_replace(["\0", '\\', '/', '@', ':', '{', '}', '(', ')'], '.', $class);
72+
}
73+
6974
return str_replace('\\', '.', $class);
7075
}
7176
}

Resources/translations/validators.bg.xlf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@
3636
</trans-unit>
3737
<trans-unit id="9">
3838
<source>This field was not expected.</source>
39-
<target>Това поле не се е очаквало.</target>
39+
<target>Полето не се е очаквало.</target>
4040
</trans-unit>
4141
<trans-unit id="10">
4242
<source>This field is missing.</source>
43-
<target>Това поле липсва.</target>
43+
<target>Полето липсва.</target>
4444
</trans-unit>
4545
<trans-unit id="11">
4646
<source>This value is not a valid date.</source>
47-
<target>Стойността не е валидна дата (date).</target>
47+
<target>Стойността не е валидна дата.</target>
4848
</trans-unit>
4949
<trans-unit id="12">
5050
<source>This value is not a valid datetime.</source>
51-
<target>Стойността не е валидна дата (datetime).</target>
51+
<target>Стойността не е валидна дата и час.</target>
5252
</trans-unit>
5353
<trans-unit id="13">
5454
<source>This value is not a valid email address.</source>
55-
<target>Стойността не е валиден email адрес.</target>
55+
<target>Стойността не е валиден имейл адрес.</target>
5656
</trans-unit>
5757
<trans-unit id="14">
5858
<source>The file could not be found.</source>
@@ -68,7 +68,7 @@
6868
</trans-unit>
6969
<trans-unit id="17">
7070
<source>The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.</source>
71-
<target>Майм типа на файла е невалиден ({{ type }}). Разрешени майм типове са {{ types }}.</target>
71+
<target>Mime типа на файла е невалиден ({{ type }}). Разрешени mime типове са {{ types }}.</target>
7272
</trans-unit>
7373
<trans-unit id="18">
7474
<source>This value should be {{ limit }} or less.</source>
@@ -104,7 +104,7 @@
104104
</trans-unit>
105105
<trans-unit id="26">
106106
<source>This value is not a valid time.</source>
107-
<target>Стойността не е валидно време (time).</target>
107+
<target>Стойността не е валидно време.</target>
108108
</trans-unit>
109109
<trans-unit id="27">
110110
<source>This value is not a valid URL.</source>
@@ -216,35 +216,35 @@
216216
</trans-unit>
217217
<trans-unit id="57">
218218
<source>Invalid card number.</source>
219-
<target>Невалиден номер на картата.</target>
219+
<target>Невалиден номер на карта.</target>
220220
</trans-unit>
221221
<trans-unit id="58">
222222
<source>Unsupported card type or invalid card number.</source>
223-
<target>Неподдържан тип карта или невалиден номер на картата.</target>
223+
<target>Неподдържан тип карта или невалиден номер на карта.</target>
224224
</trans-unit>
225225
<trans-unit id="59">
226226
<source>This is not a valid International Bank Account Number (IBAN).</source>
227-
<target>Невалиден Международен номер на банкова сметка (IBAN).</target>
227+
<target>Това не е валиден Международен номер на банкова сметка (IBAN).</target>
228228
</trans-unit>
229229
<trans-unit id="60">
230230
<source>This value is not a valid ISBN-10.</source>
231-
<target>Невалиден ISBN-10.</target>
231+
<target>Стойността не е валиден ISBN-10.</target>
232232
</trans-unit>
233233
<trans-unit id="61">
234234
<source>This value is not a valid ISBN-13.</source>
235-
<target>Невалиден ISBN-13.</target>
235+
<target>Стойността не е валиден ISBN-13.</target>
236236
</trans-unit>
237237
<trans-unit id="62">
238238
<source>This value is neither a valid ISBN-10 nor a valid ISBN-13.</source>
239-
<target>Невалидна стойност както за ISBN-10, така и за ISBN-13 .</target>
239+
<target>Стойността не е нито валиден ISBN-10, нито валиден ISBN-13.</target>
240240
</trans-unit>
241241
<trans-unit id="63">
242242
<source>This value is not a valid ISSN.</source>
243-
<target>Невалиден Международен стандартен сериен номер (ISSN).</target>
243+
<target>Стойността не е валиден ISSN.</target>
244244
</trans-unit>
245245
<trans-unit id="64">
246246
<source>This value is not a valid currency.</source>
247-
<target>Невалидна валута.</target>
247+
<target>Стойността не е валидна валута.</target>
248248
</trans-unit>
249249
<trans-unit id="65">
250250
<source>This value should be equal to {{ compared_value }}.</source>
@@ -308,11 +308,11 @@
308308
</trans-unit>
309309
<trans-unit id="80">
310310
<source>This value does not match the expected {{ charset }} charset.</source>
311-
<target>Стойността не съвпада с {{ charset }}.</target>
311+
<target>Стойността не съвпада с очакваната {{ charset }} кодировка.</target>
312312
</trans-unit>
313313
<trans-unit id="81">
314314
<source>This is not a valid Business Identifier Code (BIC).</source>
315-
<target>Невалиден бизнес идентификационен код (BIC).</target>
315+
<target>Това не е валиден Бизнес идентификационен код (BIC).</target>
316316
</trans-unit>
317317
<trans-unit id="82">
318318
<source>Error</source>
@@ -324,15 +324,15 @@
324324
</trans-unit>
325325
<trans-unit id="84">
326326
<source>This value should be a multiple of {{ compared_value }}.</source>
327-
<target>Тази стойност трябва да бъде кратно число на {{ compared_value }}.</target>
327+
<target>Стойността трябва да бъде кратно число на {{ compared_value }}.</target>
328328
</trans-unit>
329329
<trans-unit id="85">
330330
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
331-
<target>Този бизнес идентификационен код (BIC) не е свързана с IBAN {{ iban }}.</target>
331+
<target>Бизнес идентификационния код (BIC) не е свързан с IBAN {{ iban }}.</target>
332332
</trans-unit>
333333
<trans-unit id="86">
334334
<source>This value should be valid JSON.</source>
335-
<target>Тази стойност трябва да е валидна JSON.</target>
335+
<target>Стойността трябва да е валиден JSON.</target>
336336
</trans-unit>
337337
</body>
338338
</file>

Resources/translations/validators.cs.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,22 @@
318318
<source>Error</source>
319319
<target>Chyba</target>
320320
</trans-unit>
321+
<trans-unit id="83">
322+
<source>This is not a valid UUID.</source>
323+
<target>Tato hodnota není platné UUID.</target>
324+
</trans-unit>
325+
<trans-unit id="84">
326+
<source>This value should be a multiple of {{ compared_value }}.</source>
327+
<target>Tato hodnota musí být násobek hodnoty {{ compared_value }}.</target>
328+
</trans-unit>
329+
<trans-unit id="85">
330+
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
331+
<target>Bankovní identifikační kód (BIC) neodpovídá mezinárodnímu číslu účtu (IBAN) {{ iban }}.</target>
332+
</trans-unit>
333+
<trans-unit id="86">
334+
<source>This value should be valid JSON.</source>
335+
<target>Tato hodnota musí být validní JSON.</target>
336+
</trans-unit>
321337
</body>
322338
</file>
323339
</xliff>

Tests/Mapping/Cache/Psr6CacheTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,12 @@ public function testNameCollision()
2323
$this->cache->write($metadata);
2424
$this->assertFalse($this->cache->has('Foo_Bar'));
2525
}
26+
27+
public function testNameWithInvalidChars()
28+
{
29+
$metadata = new ClassMetadata('class@anonymous/path/file');
30+
31+
$this->cache->write($metadata);
32+
$this->assertTrue($this->cache->has('class@anonymous/path/file'));
33+
}
2634
}

0 commit comments

Comments
 (0)