Skip to content

Commit

Permalink
Merge branch '4.4' into 5.2
Browse files Browse the repository at this point in the history
* 4.4:
  [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
  • Loading branch information
fabpot committed May 16, 2021
2 parents 445caa7 + 424d29d commit 61af68d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Loader/XliffFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s
private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain)
{
$xml = simplexml_import_dom($dom);
$encoding = strtoupper($dom->encoding);
$encoding = $dom->encoding ? strtoupper($dom->encoding) : null;

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

Expand Down
2 changes: 1 addition & 1 deletion Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ protected function computeFallbackLocales(string $locale)
*/
protected function assertValidLocale(string $locale)
{
if (1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) {
if (null !== $locale && 1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) {
throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale));
}
}
Expand Down

0 comments on commit 61af68d

Please sign in to comment.