Skip to content

Commit 31fa765

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: [Security][Validator] Update Hebrew translations [Finder] Add support of no-capture regex modifier in MultiplePcreFilterIterator (available from PHP 8.2)
2 parents 1f15392 + 2687623 commit 31fa765

File tree

4 files changed

+51
-19
lines changed

4 files changed

+51
-19
lines changed

src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ protected function isAccepted(string $string)
8484
*/
8585
protected function isRegex(string $str)
8686
{
87-
if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) {
87+
$availableModifiers = 'imsxuADU';
88+
89+
if (\PHP_VERSION_ID >= 80200) {
90+
$availableModifiers .= 'n';
91+
}
92+
93+
if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) {
8894
$start = substr($m[1], 0, 1);
8995
$end = substr($m[1], -1);
9096

src/Symfony/Component/Finder/Tests/Iterator/MultiplePcreFilterIteratorTest.php

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,26 @@ public function testIsRegex($string, $isRegex, $message)
2727

2828
public function getIsRegexFixtures()
2929
{
30-
return [
31-
['foo', false, 'string'],
32-
[' foo ', false, '" " is not a valid delimiter'],
33-
['\\foo\\', false, '"\\" is not a valid delimiter'],
34-
['afooa', false, '"a" is not a valid delimiter'],
35-
['//', false, 'the pattern should contain at least 1 character'],
36-
['/a/', true, 'valid regex'],
37-
['/foo/', true, 'valid regex'],
38-
['/foo/i', true, 'valid regex with a single modifier'],
39-
['/foo/imsxu', true, 'valid regex with multiple modifiers'],
40-
['#foo#', true, '"#" is a valid delimiter'],
41-
['{foo}', true, '"{,}" is a valid delimiter pair'],
42-
['[foo]', true, '"[,]" is a valid delimiter pair'],
43-
['(foo)', true, '"(,)" is a valid delimiter pair'],
44-
['<foo>', true, '"<,>" is a valid delimiter pair'],
45-
['*foo.*', false, '"*" is not considered as a valid delimiter'],
46-
['?foo.?', false, '"?" is not considered as a valid delimiter'],
47-
];
30+
yield ['foo', false, 'string'];
31+
yield [' foo ', false, '" " is not a valid delimiter'];
32+
yield ['\\foo\\', false, '"\\" is not a valid delimiter'];
33+
yield ['afooa', false, '"a" is not a valid delimiter'];
34+
yield ['//', false, 'the pattern should contain at least 1 character'];
35+
yield ['/a/', true, 'valid regex'];
36+
yield ['/foo/', true, 'valid regex'];
37+
yield ['/foo/i', true, 'valid regex with a single modifier'];
38+
yield ['/foo/imsxu', true, 'valid regex with multiple modifiers'];
39+
yield ['#foo#', true, '"#" is a valid delimiter'];
40+
yield ['{foo}', true, '"{,}" is a valid delimiter pair'];
41+
yield ['[foo]', true, '"[,]" is a valid delimiter pair'];
42+
yield ['(foo)', true, '"(,)" is a valid delimiter pair'];
43+
yield ['<foo>', true, '"<,>" is a valid delimiter pair'];
44+
yield ['*foo.*', false, '"*" is not considered as a valid delimiter'];
45+
yield ['?foo.?', false, '"?" is not considered as a valid delimiter'];
46+
47+
if (\PHP_VERSION_ID >= 80200) {
48+
yield ['/foo/n', true, 'valid regex with the no-capture modifier'];
49+
}
4850
}
4951
}
5052

src/Symfony/Component/Security/Core/Resources/translations/security.he.xlf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@
7070
<source>Invalid or expired login link.</source>
7171
<target>קישור כניסה לא חוקי או שפג תוקפו.</target>
7272
</trans-unit>
73+
<trans-unit id="19">
74+
<source>Too many failed login attempts, please try again in %minutes% minute.</source>
75+
<target>יותר מדי ניסיונות כניסה כושלים, אנא נסה שוב בוד %minutes% דקה.</target>
76+
</trans-unit>
77+
<trans-unit id="20">
78+
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
79+
<target>יותר מדי ניסיונות כניסה כושלים, אנא נסה שוב בוד %minutes% דקות.</target>
80+
</trans-unit>
7381
</body>
7482
</file>
7583
</xliff>

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,22 @@
386386
<source>This value is not a valid International Securities Identification Number (ISIN).</source>
387387
<target>ערך זה אינו מספר זיהוי ניירות ערך בינלאומי תקף (ISIN).</target>
388388
</trans-unit>
389+
<trans-unit id="100">
390+
<source>This value should be a valid expression.</source>
391+
<target>ערך זה חייב להיות ביטוי חוקי.</target>
392+
</trans-unit>
393+
<trans-unit id="101">
394+
<source>This value is not a valid CSS color.</source>
395+
<target>ערך זה אינו צבע CSS חוקי.</target>
396+
</trans-unit>
397+
<trans-unit id="102">
398+
<source>This value is not a valid CIDR notation.</source>
399+
<target>ערך זה אינו סימון CIDR חוקי.</target>
400+
</trans-unit>
401+
<trans-unit id="103">
402+
<source>The value of the netmask should be between {{ min }} and {{ max }}.</source>
403+
<target>הערך של מסכת הרשת חייב להיות בין {{ min }} ו {{ max }}.</target>
404+
</trans-unit>
389405
</body>
390406
</file>
391407
</xliff>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy