Skip to content

Commit f504ce5

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: [Finder] Fix gitignore regex build with "**" Fixed deprecation warnings about passing null as parameter [Security] Keep Bulgarian wording consistent across all texts. Migrate configuration file for PHP CS Fixer 2.19/3.0 [Form] Replace broken ServerParams mock [Mailer] Fix SES API call with UTF-8 Addresses
2 parents 4638bf5 + 61af68d commit f504ce5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Loader/XliffFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s
147147
private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain)
148148
{
149149
$xml = simplexml_import_dom($dom);
150-
$encoding = strtoupper($dom->encoding);
150+
$encoding = $dom->encoding ? strtoupper($dom->encoding) : null;
151151

152152
$xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:2.0');
153153

Translator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ protected function computeFallbackLocales(string $locale)
454454
*/
455455
protected function assertValidLocale(string $locale)
456456
{
457-
if (1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) {
457+
if (null !== $locale && 1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) {
458458
throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale));
459459
}
460460
}

0 commit comments

Comments
 (0)